mautourco-components 0.2.40 → 0.2.42
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/Button/Button.css +1 -2075
- package/dist/components/atoms/CardServiceAccom/CardServiceAccom.css +1 -2074
- package/dist/components/atoms/Chip/Chip.css +1 -2074
- package/dist/components/atoms/Divider/Divider.css +1 -2075
- package/dist/components/atoms/Tab/Tab.css +1 -2074
- package/dist/components/molecules/ActionDropdown/ActionDropdown.css +1 -2074
- package/dist/components/molecules/AddItemButton/AddItemButton.css +1 -2074
- package/dist/components/molecules/BookingPax/BookingPaxClient/BookingPaxClient.css +1 -2076
- package/dist/components/molecules/BookingPax/BookingPaxLayout/BookingPaxLayout.css +1 -2075
- package/dist/components/molecules/BookingResume/BookingResumeLayout/BookingResumeLayout.css +1 -2074
- package/dist/components/molecules/BookingResume/ResumeAccom/ResumeAccom.css +1 -2074
- package/dist/components/molecules/BookingResume/ResumeExcursion/ResumeExcursion.css +1 -2074
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.css +1 -2074
- package/dist/components/molecules/DateDisplay/DateDisplay.css +1 -2074
- package/dist/components/molecules/DetailsInfo/DetailsAgency/DetailsAgency.css +1 -2074
- package/dist/components/molecules/DetailsInfo/DetailsClient/DetailsClient.css +1 -2075
- package/dist/components/molecules/DialogContentPolicy/CancellationLayout/CancellationLayout.css +1 -2076
- package/dist/components/molecules/FeatureRow/FeatureRow.css +1 -2075
- package/dist/components/molecules/Pagination/Pagination.css +1 -2075
- package/dist/components/molecules/PaxDisplay/PaxDisplay.css +1 -2074
- package/dist/components/molecules/PriceDisplay/PriceDisplay.css +1 -2075
- package/dist/components/molecules/SectionTitle/SectionTitle.css +1 -2076
- package/dist/components/molecules/ServiceInfo/ServiceInfo.css +1 -2074
- package/dist/components/molecules/ServiceTitle/ServiceTitle.css +1 -2074
- package/dist/components/molecules/Stepper/Stepper.css +1 -2075
- package/dist/components/molecules/StepperTimeline/StepperTimeline.css +1 -2074
- package/dist/components/molecules/TextWithBorderBottom/TextWithBorderBottom.css +1 -2074
- package/dist/components/molecules/TimelineItem/TimelineHeader.css +1 -2075
- package/dist/components/molecules/TimelineItem/TimelineItem.css +1 -2074
- package/dist/components/molecules/Toast/Toast.css +1 -2074
- package/dist/components/organisms/Booking/Booking.css +1 -2074
- package/dist/components/organisms/Booking/BookingDocket/BookingDocket.css +1 -2074
- package/dist/components/organisms/Booking/BookingStep/BookingStep.css +1 -2076
- package/dist/components/organisms/CarBookingCard/CarBookingCard.css +1 -2076
- package/dist/components/organisms/CarBookingCard/CarBookingCardSkeleton.css +1 -2075
- package/dist/components/organisms/DialogCancelService/CancelBooking/CancelBooking.css +1 -2074
- package/dist/components/organisms/DialogCancelService/ConfirmDelete/ConfirmDelete.css +1 -2074
- package/dist/components/organisms/DialogComparison/DialogComparison.css +1 -2074
- package/dist/components/organisms/DialogDeleteConfirm/DialogDeleteConfirmMultiple/DialogDeleteConfirmMultiple.css +1 -2075
- package/dist/components/organisms/DialogSendingMail/DialogSendingMailMultiple/DialogSendingMailMultiple.css +1 -2074
- package/dist/components/organisms/QuoteHeader/QuoteHeader.css +4 -2082
- package/dist/components/organisms/QuoteHeader/QuoteHeader.d.ts +1 -1
- package/dist/components/organisms/TabCancellationPolicy/HeaderExcursion/HeaderTransfer.css +1 -2074
- package/dist/components/organisms/TabCancellationPolicy/PolicyAccom/PolicyAccom.css +1 -2075
- package/dist/components/organisms/TabCancellationPolicy/TabCancellationPolicyLayout/TabCancellationPolicyLayout.css +1 -2074
- package/dist/components/organisms/TabServiceDetails/TabServiceDetailsLayout/TabServiceDetailsLayout.css +1 -2074
- package/dist/components/organisms/Table/Table.css +1 -2074
- package/dist/styles/components/avatar.css +1 -2073
- package/dist/styles/components/calendar.css +1 -2073
- package/dist/styles/components/checkbox.css +1 -2073
- package/dist/styles/components/dropdown.css +1 -2073
- package/dist/styles/components/forms.css +1 -2073
- package/dist/styles/components/illustration.css +1 -2073
- package/dist/styles/components/molecule/accomodation-docket.css +1 -2073
- package/dist/styles/components/molecule/calendarInput.css +1 -2073
- package/dist/styles/components/molecule/dateTime.css +1 -2073
- package/dist/styles/components/molecule/docket-prices.css +1 -2073
- package/dist/styles/components/molecule/excursion-docket.css +1 -2073
- package/dist/styles/components/molecule/location-dropdown.css +1 -2073
- package/dist/styles/components/molecule/other-service-docket.css +1 -2073
- package/dist/styles/components/molecule/service-selector.css +1 -2073
- package/dist/styles/components/molecule/timePicker.css +1 -2073
- package/dist/styles/components/molecule/toast.css +1 -2073
- package/dist/styles/components/molecule/transfer-docket.css +1 -2073
- package/dist/styles/components/multiselect-dropdown.css +1 -2073
- package/dist/styles/components/organism/card-container.css +1 -2073
- package/dist/styles/components/organism/dialog.css +1 -2073
- package/dist/styles/components/organism/docket.css +1 -2073
- package/dist/styles/components/organism/footer.css +1 -2073
- package/dist/styles/components/organism/multiple-quotation-docket.css +1 -2073
- package/dist/styles/components/organism/pax-selector.css +1 -2073
- package/dist/styles/components/organism/round-trip.css +1 -2073
- package/dist/styles/components/organism/search-bar-transfer.css +1 -2073
- package/dist/styles/components/organism/topnavigation.css +1 -2073
- package/dist/styles/components/organism/transfer-line.css +1 -2073
- package/dist/styles/components/rating-star.css +1 -2073
- package/dist/styles/components/rating-tab.css +1 -2073
- package/dist/styles/components/scrollbar.css +1 -2073
- package/dist/styles/components/segmented-button.css +1 -2073
- package/dist/styles/components/selected-value.css +1 -2073
- package/dist/styles/components/slider.css +1 -2073
- package/dist/styles/components/typography.css +1 -1
- package/package.json +1 -1
- package/src/components/organisms/QuoteHeader/QuoteHeader.css +5 -2
- package/src/components/organisms/QuoteHeader/QuoteHeader.tsx +1 -1
- package/dist/components/atoms/Icon/icons/ChevronDownIcon.d.ts +0 -8
- package/dist/components/atoms/Icon/icons/ChevronDownIcon.js +0 -30
- package/dist/components/organisms/BookingAddItem/AddItemNewService.d.ts +0 -12
- package/dist/components/organisms/BookingAddItem/AddItemNewService.js +0 -48
- package/dist/components/organisms/BookingAddItem/AddItemSelector.d.ts +0 -9
- package/dist/components/organisms/BookingAddItem/AddItemSelector.js +0 -23
- package/dist/components/organisms/BookingAddItem/BookingAddItem.d.ts +0 -16
- package/dist/components/organisms/BookingAddItem/BookingAddItem.js +0 -66
- package/dist/components/organisms/BookingAddItem/index.d.ts +0 -3
- package/dist/components/organisms/BookingAddItem/index.js +0 -3
|
@@ -2415,4 +2415,4 @@
|
|
|
2415
2415
|
|
|
2416
2416
|
.body-lg-leading-none--bold { font-weight: var(--font-weight-font-bold, 700); }
|
|
2417
2417
|
|
|
2418
|
-
.body-lg-leading-none--black { font-weight: var(--font-weight-font-black, 900); }
|
|
2418
|
+
.body-lg-leading-none--black { font-weight: var(--font-weight-font-black, 900); }
|
package/package.json
CHANGED
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
@apply px-2 relative mb-10;
|
|
9
9
|
&::before {
|
|
10
10
|
content: '';
|
|
11
|
-
@apply absolute
|
|
11
|
+
@apply absolute;
|
|
12
|
+
left: 0;
|
|
13
|
+
top: 50%;
|
|
14
|
+
transform: translateY(-50%);
|
|
12
15
|
@apply w-1 h-8;
|
|
13
16
|
background-color: var(--color-elevation-brand-subtle);
|
|
14
17
|
}
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
|
|
30
33
|
.quote-header__filters {
|
|
31
34
|
@apply flex gap-3 my-8;
|
|
32
|
-
.dropdown-container {
|
|
35
|
+
.mtc-dropdown-container {
|
|
33
36
|
width: 139px;
|
|
34
37
|
}
|
|
35
38
|
}
|
|
@@ -20,7 +20,7 @@ export interface QuoteHeaderProps {
|
|
|
20
20
|
/** Callback to create a new quote */
|
|
21
21
|
onNewQuote: () => void;
|
|
22
22
|
|
|
23
|
-
onFilterChange
|
|
23
|
+
onFilterChange?: (filter: 'date' | 'clientType' | 'fileStatus', value: string) => void;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const filterConfig = {
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
var ChevronDownIcon = function (_a) {
|
|
14
|
-
var _b = _a.size, size = _b === void 0 ? 'md' : _b, _c = _a.className, className = _c === void 0 ? '' : _c, color = _a.color;
|
|
15
|
-
var getSizeClasses = function () {
|
|
16
|
-
switch (size) {
|
|
17
|
-
case 'xs': return 'w-3 h-3';
|
|
18
|
-
case 'sm': return 'w-4 h-4';
|
|
19
|
-
case 'md': return 'w-5 h-5';
|
|
20
|
-
case 'lg': return 'w-6 h-6';
|
|
21
|
-
case 'xl': return 'w-8 h-8';
|
|
22
|
-
default: return 'w-5 h-5';
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
var sizeClasses = getSizeClasses();
|
|
26
|
-
var colorClass = color ? "text-".concat(color) : 'text-current';
|
|
27
|
-
var classes = "".concat(sizeClasses, " ").concat(colorClass, " ").concat(className);
|
|
28
|
-
return (_jsx("svg", __assign({ className: classes, viewBox: "0 0 15 12", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsx("path", { d: "M12.4707 0.571533H2.07621C0.87817 0.571533 0.163582 1.90675 0.828137 2.90358L6.02536 10.6994C6.6191 11.59 7.92778 11.59 8.52151 10.6994L13.7187 2.90358C14.3833 1.90675 13.6687 0.571533 12.4707 0.571533Z", fill: "currentColor", stroke: "currentColor", strokeWidth: "1.14286" }) })));
|
|
29
|
-
};
|
|
30
|
-
export default ChevronDownIcon;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BookingPaxClientInfo } from '../../molecules/BookingPax';
|
|
3
|
-
import { ServiceOption, ServiceType } from '../../molecules/ServiceSelector';
|
|
4
|
-
export interface AddItemNewServiceProps {
|
|
5
|
-
options?: ServiceOption[];
|
|
6
|
-
date: string | string[];
|
|
7
|
-
clients: BookingPaxClientInfo[];
|
|
8
|
-
onServiceChange: (service: ServiceType) => void;
|
|
9
|
-
onNext: (selectedClients: BookingPaxClientInfo[]) => void;
|
|
10
|
-
onBack: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const AddItemNewService: React.FC<AddItemNewServiceProps>;
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
-
if (ar || !(i in from)) {
|
|
15
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
-
ar[i] = from[i];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
-
};
|
|
21
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
import { useCallback, useState } from 'react';
|
|
23
|
-
import Button from '../../atoms/Button/Button';
|
|
24
|
-
import Checkbox from '../../atoms/Checkbox/Checkbox';
|
|
25
|
-
import { Text } from '../../atoms/Typography/Typography';
|
|
26
|
-
import ServiceSelector from '../../molecules/ServiceSelector';
|
|
27
|
-
import DateTimePicker from '../DateTimePicker/DateTimePicker';
|
|
28
|
-
export var AddItemNewService = function (props) {
|
|
29
|
-
var date = props.date, options = props.options, clients = props.clients, onServiceChange = props.onServiceChange, onNext = props.onNext, onBack = props.onBack;
|
|
30
|
-
var _a = useState('accommodation'), service = _a[0], setService = _a[1];
|
|
31
|
-
var _b = useState([]), selectedClients = _b[0], setSelectedClients = _b[1];
|
|
32
|
-
var handleServiceChange = function (service) {
|
|
33
|
-
onServiceChange(service);
|
|
34
|
-
setService(service);
|
|
35
|
-
};
|
|
36
|
-
var isAccommodation = service === 'accommodation';
|
|
37
|
-
var selectionMode = isAccommodation ? 'range' : 'single';
|
|
38
|
-
var numberOfMonths = isAccommodation ? 2 : 1;
|
|
39
|
-
var handleClientChange = useCallback(function (client) {
|
|
40
|
-
if (selectedClients.includes(client)) {
|
|
41
|
-
setSelectedClients(selectedClients.filter(function (c) { return c.clientId !== client.clientId; }));
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
setSelectedClients(__spreadArray(__spreadArray([], selectedClients, true), [client], false));
|
|
45
|
-
}
|
|
46
|
-
}, [selectedClients]);
|
|
47
|
-
return (_jsxs("div", __assign({ className: "space-y-9" }, { children: [_jsxs("div", __assign({ className: "flex sm:items-center gap-4 flex-col sm:flex-row" }, { children: [_jsx(ServiceSelector, { className: "sm:basis-[245px] xl:basis-[260px] shrink-0 grow-0", value: service, onChange: handleServiceChange, options: options }), _jsx("div", __assign({ className: "sm:basis-[245px] xl:basis-[260px] shrink-0 grow-0" }, { children: _jsx(DateTimePicker, { mode: "calendar", selectionMode: selectionMode, defaultValue: date, placeholder: "Select date", numberOfMonths: numberOfMonths, iconPosition: "left", iconBGFull: false, showChevron: true }) }))] })), _jsxs("div", __assign({ className: "space-y-4" }, { children: [_jsx(Text, __assign({ variant: "bold" }, { children: "Please select the pax affected by the new service" })), _jsx("ul", { children: clients.map(function (client, index) { return (_jsx("li", { children: _jsx(Checkbox, { id: "cl-".concat(index), label: "".concat(client.firstName, " ").concat(client.lastName, " (").concat(client.clientType).concat(client.clientType !== 'Adult' ? " - ".concat(client.age, " years old") : '', ")"), checked: selectedClients.some(function (c) { return c.clientId === client.clientId; }), onChange: function () { return handleClientChange(client); } }) }, "cl-".concat(index))); }) })] })), _jsxs("div", __assign({ className: "flex justify-end gap-x-4 [&>*]:w-[250px] pb-2" }, { children: [_jsx(Button, __assign({ variant: "outline-secondary", onClick: onBack }, { children: "Back" })), _jsx(Button, __assign({ variant: "secondary", onClick: function () { return onNext(selectedClients); }, disabled: selectedClients.length === 0 }, { children: "Next" }))] }))] })));
|
|
48
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare enum AddItemType {
|
|
3
|
-
NEW = "NEW",
|
|
4
|
-
EXISTING = "EXISTING"
|
|
5
|
-
}
|
|
6
|
-
export interface AddItemSelectorProps {
|
|
7
|
-
onAddItem?: (type: AddItemType) => void;
|
|
8
|
-
}
|
|
9
|
-
export declare const AddItemSelector: React.FC<AddItemSelectorProps>;
|
|
@@ -1,23 +0,0 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { Text } from '../../atoms/Typography/Typography';
|
|
14
|
-
import { AddItemButton } from '../../molecules/AddItemButton/AddItemButton';
|
|
15
|
-
export var AddItemType;
|
|
16
|
-
(function (AddItemType) {
|
|
17
|
-
AddItemType["NEW"] = "NEW";
|
|
18
|
-
AddItemType["EXISTING"] = "EXISTING";
|
|
19
|
-
})(AddItemType || (AddItemType = {}));
|
|
20
|
-
export var AddItemSelector = function (_a) {
|
|
21
|
-
var onAddItem = _a.onAddItem;
|
|
22
|
-
return (_jsxs("div", __assign({ className: "space-y-9" }, { children: [_jsx(Text, __assign({ size: "sm", variant: "medium" }, { children: "If you are sure you want to add this service, please confirm below. New prices and cancellation policies will apply to the added service." })), _jsxs("div", __assign({ className: "grid grid-cols-2 gap-4" }, { children: [_jsx(AddItemButton, { label: _jsxs(_Fragment, { children: ["Add new service ", _jsx("br", {}), " and new pax"] }), onClick: function () { return onAddItem === null || onAddItem === void 0 ? void 0 : onAddItem(AddItemType.NEW); } }), _jsx(AddItemButton, { label: _jsxs(_Fragment, { children: ["Add new service ", _jsx("br", {}), " for your existing pax"] }), onClick: function () { return onAddItem === null || onAddItem === void 0 ? void 0 : onAddItem(AddItemType.EXISTING); } })] })), _jsx(Text, __assign({ size: "sm", variant: "medium" }, { children: "Note: This action is irreversible and cannot be undone." }))] })));
|
|
23
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { BookingPaxClientInfo } from '../../molecules/BookingPax';
|
|
3
|
-
import { ServiceOption, ServiceType } from '../../molecules/ServiceSelector';
|
|
4
|
-
import { AddItemType } from './AddItemSelector';
|
|
5
|
-
export interface BookingAddItemProps {
|
|
6
|
-
open: boolean;
|
|
7
|
-
serviceDate?: string | string[];
|
|
8
|
-
serviceOptions?: ServiceOption[];
|
|
9
|
-
clients: BookingPaxClientInfo[];
|
|
10
|
-
setOpen: (open: boolean) => void;
|
|
11
|
-
onAddItem?: (type: AddItemType) => void;
|
|
12
|
-
onServiceChange?: (service: ServiceType) => void;
|
|
13
|
-
onValidatePax?: (selectedClients: BookingPaxClientInfo[]) => void;
|
|
14
|
-
onBackToSelector?: () => void;
|
|
15
|
-
}
|
|
16
|
-
export declare const BookingAddItem: React.FC<BookingAddItemProps>;
|
|
@@ -1,66 +0,0 @@
|
|
|
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
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { AnimatePresence, domAnimation, LazyMotion } from 'motion/react';
|
|
25
|
-
import * as motion from 'motion/react-m';
|
|
26
|
-
import { useLayoutEffect, useRef, useState } from 'react';
|
|
27
|
-
import { DEFAULT_SERVICE_SELECTOR_OPTIONS } from '../../molecules/ServiceSelector/ServiceSelector';
|
|
28
|
-
import Dialog from '../Dialog/Dialog';
|
|
29
|
-
import { AddItemNewService } from './AddItemNewService';
|
|
30
|
-
import { AddItemSelector, AddItemType } from './AddItemSelector';
|
|
31
|
-
export var BookingAddItem = function (props) {
|
|
32
|
-
var open = props.open, _a = props.serviceDate, serviceDate = _a === void 0 ? [] : _a, _b = props.serviceOptions, serviceOptions = _b === void 0 ? [] : _b, clients = props.clients, setOpen = props.setOpen, onAddItem = props.onAddItem, onServiceChange = props.onServiceChange, onValidatePax = props.onValidatePax, onBackToSelector = props.onBackToSelector;
|
|
33
|
-
var _c = useState(null), selectedType = _c[0], setSelectedType = _c[1];
|
|
34
|
-
var contentRef = useRef(null);
|
|
35
|
-
var _d = useState('auto'), contentHeight = _d[0], setContentHeight = _d[1];
|
|
36
|
-
var handleAddItem = function (type) {
|
|
37
|
-
onAddItem === null || onAddItem === void 0 ? void 0 : onAddItem(type);
|
|
38
|
-
setSelectedType(type);
|
|
39
|
-
console.log(type);
|
|
40
|
-
};
|
|
41
|
-
var handleClose = function () {
|
|
42
|
-
setOpen(false);
|
|
43
|
-
setSelectedType(null);
|
|
44
|
-
};
|
|
45
|
-
// Measure and update content height when selectedType changes
|
|
46
|
-
useLayoutEffect(function () {
|
|
47
|
-
setTimeout(function () {
|
|
48
|
-
if (contentRef.current && open) {
|
|
49
|
-
var measuredHeight = contentRef.current.scrollHeight;
|
|
50
|
-
setContentHeight(measuredHeight);
|
|
51
|
-
}
|
|
52
|
-
}, 50);
|
|
53
|
-
}, [selectedType, open, serviceDate, serviceOptions, clients]);
|
|
54
|
-
var title = selectedType === AddItemType.EXISTING
|
|
55
|
-
? 'Add new service to your existing pax'
|
|
56
|
-
: 'Select how to add items to your booking';
|
|
57
|
-
return (_jsx(Dialog, __assign({ isOpen: open, onClose: handleClose, showFooter: false, title: title, className: "!max-w-[798px]" }, { children: _jsx(LazyMotion, __assign({ features: domAnimation }, { children: _jsx(motion.div, __assign({ animate: { height: contentHeight }, transition: { duration: 0.2, ease: 'easeInOut' }, style: { overflow: 'hidden' } }, { children: _jsx("div", __assign({ ref: contentRef }, { children: _jsx(AnimatePresence, __assign({ mode: "wait" }, { children: selectedType === AddItemType.EXISTING ? (_jsx(motion.div, __assign({ initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: 10 }, transition: { duration: 0.25, ease: 'easeInOut' } }, { children: _jsx(AddItemNewService, { date: serviceDate, onServiceChange: function (service) { return onServiceChange === null || onServiceChange === void 0 ? void 0 : onServiceChange(service); }, options: serviceOptions.length > 0
|
|
58
|
-
? serviceOptions
|
|
59
|
-
: DEFAULT_SERVICE_SELECTOR_OPTIONS.map(function (_a) {
|
|
60
|
-
var disabled = _a.disabled, badge = _a.badge, option = __rest(_a, ["disabled", "badge"]);
|
|
61
|
-
return option;
|
|
62
|
-
}), clients: clients, onNext: function (selectedClients) { return onValidatePax === null || onValidatePax === void 0 ? void 0 : onValidatePax(selectedClients); }, onBack: function () {
|
|
63
|
-
onBackToSelector === null || onBackToSelector === void 0 ? void 0 : onBackToSelector();
|
|
64
|
-
setSelectedType(null);
|
|
65
|
-
} }) }), "add-item-new-service")) : (_jsx(motion.div, __assign({ initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 }, exit: { opacity: 0, y: 10 }, transition: { duration: 0.25, ease: 'easeInOut' } }, { children: _jsx(AddItemSelector, { onAddItem: handleAddItem }) }), "add-item-selector")) })) })) })) })) })));
|
|
66
|
-
};
|