@qite/tide-booking-component 1.4.38 → 1.4.40
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/build/build-cjs/booking-wizard/types.d.ts +1 -0
- package/build/build-cjs/content/components/login.d.ts +3 -0
- package/build/build-cjs/index.js +7618 -1952
- package/build/build-cjs/qsm/components/double-search-input-group/index.d.ts +2 -1
- package/build/build-cjs/qsm/components/search-input/index.d.ts +1 -0
- package/build/build-cjs/qsm/components/search-input-group/index.d.ts +3 -1
- package/build/build-cjs/qsm/store/qsm-slice.d.ts +6 -2
- package/build/build-cjs/qsm/types.d.ts +17 -32
- package/build/build-cjs/search-results/components/filters/flight-filters.d.ts +8 -0
- package/build/build-cjs/search-results/components/flight/flight-accommodation-results.d.ts +4 -1
- package/build/build-cjs/search-results/components/flight/flight-option.d.ts +7 -0
- package/build/build-cjs/search-results/components/flight/flight-search-context/index.d.ts +36 -0
- package/build/build-cjs/search-results/components/icon.d.ts +1 -0
- package/build/build-cjs/search-results/components/item-picker/index.d.ts +5 -3
- package/build/build-cjs/search-results/components/search-results-container/flight-search-results.d.ts +6 -0
- package/build/build-cjs/search-results/store/search-results-slice.d.ts +2 -0
- package/build/build-cjs/search-results/types.d.ts +31 -1
- package/build/build-cjs/search-results/utils/flight-utils.d.ts +16 -0
- package/build/build-cjs/shared/components/flyin.d.ts +9 -0
- package/build/build-cjs/shared/types.d.ts +6 -0
- package/build/build-cjs/shared/utils/localization-util.d.ts +91 -0
- package/build/build-esm/booking-wizard/types.d.ts +1 -0
- package/build/build-esm/content/components/login.d.ts +3 -0
- package/build/build-esm/index.js +8053 -2356
- package/build/build-esm/qsm/components/double-search-input-group/index.d.ts +2 -1
- package/build/build-esm/qsm/components/search-input/index.d.ts +1 -0
- package/build/build-esm/qsm/components/search-input-group/index.d.ts +3 -1
- package/build/build-esm/qsm/store/qsm-slice.d.ts +6 -2
- package/build/build-esm/qsm/types.d.ts +17 -32
- package/build/build-esm/search-results/components/filters/flight-filters.d.ts +8 -0
- package/build/build-esm/search-results/components/flight/flight-accommodation-results.d.ts +4 -1
- package/build/build-esm/search-results/components/flight/flight-option.d.ts +7 -0
- package/build/build-esm/search-results/components/flight/flight-search-context/index.d.ts +36 -0
- package/build/build-esm/search-results/components/icon.d.ts +1 -0
- package/build/build-esm/search-results/components/item-picker/index.d.ts +5 -3
- package/build/build-esm/search-results/components/search-results-container/flight-search-results.d.ts +6 -0
- package/build/build-esm/search-results/store/search-results-slice.d.ts +2 -0
- package/build/build-esm/search-results/types.d.ts +31 -1
- package/build/build-esm/search-results/utils/flight-utils.d.ts +16 -0
- package/build/build-esm/shared/components/flyin.d.ts +9 -0
- package/build/build-esm/shared/types.d.ts +6 -0
- package/build/build-esm/shared/utils/localization-util.d.ts +91 -0
- package/package.json +4 -3
- package/rollup.config.js +2 -2
- package/src/booking-product/components/dates.tsx +1 -1
- package/src/booking-wizard/features/booking/booking-slice.ts +4 -2
- package/src/booking-wizard/types.ts +1 -0
- package/src/content/components/login.tsx +162 -0
- package/src/content/components/slider.tsx +1 -1
- package/src/content/features/content-page/content-page-self-contained.tsx +56 -75
- package/src/qsm/components/QSMContainer/qsm-container.tsx +197 -75
- package/src/qsm/components/double-search-input-group/index.tsx +14 -75
- package/src/qsm/components/mobile-filter-modal/index.tsx +18 -11
- package/src/qsm/components/search-input/index.tsx +9 -2
- package/src/qsm/components/search-input-group/index.tsx +19 -31
- package/src/qsm/components/travel-class-picker/index.tsx +1 -0
- package/src/qsm/components/travel-input/index.tsx +4 -4
- package/src/qsm/components/travel-input-group/index.tsx +4 -3
- package/src/qsm/components/travel-nationality-picker/index.tsx +1 -0
- package/src/qsm/components/travel-type-picker/index.tsx +1 -0
- package/src/qsm/qsm-configuration-context.ts +6 -17
- package/src/qsm/store/qsm-slice.ts +13 -1
- package/src/qsm/types.ts +19 -39
- package/src/search-results/components/filters/flight-filters.tsx +671 -0
- package/src/search-results/components/flight/flight-accommodation-results.tsx +20 -562
- package/src/search-results/components/flight/flight-banner.tsx +1 -1
- package/src/search-results/components/flight/flight-option.tsx +243 -0
- package/src/search-results/components/flight/flight-search-context/index.tsx +508 -0
- package/src/search-results/components/hotel/hotel-card.tsx +0 -1
- package/src/search-results/components/icon.tsx +84 -44
- package/src/search-results/components/item-picker/index.tsx +16 -11
- package/src/search-results/components/search-results-container/flight-search-results.tsx +120 -0
- package/src/search-results/components/search-results-container/search-results-container.tsx +85 -70
- package/src/search-results/store/search-results-slice.ts +6 -0
- package/src/search-results/types.ts +37 -1
- package/src/search-results/utils/flight-utils.ts +106 -0
- package/src/shared/components/flyin.tsx +334 -0
- package/src/shared/translations/ar-SA.json +13 -1
- package/src/shared/translations/da-DK.json +13 -1
- package/src/shared/translations/de-DE.json +13 -1
- package/src/shared/translations/en-GB.json +13 -1
- package/src/shared/translations/es-ES.json +13 -1
- package/src/shared/translations/fr-BE.json +13 -1
- package/src/shared/translations/fr-FR.json +13 -1
- package/src/shared/translations/is-IS.json +13 -1
- package/src/shared/translations/it-IT.json +13 -1
- package/src/shared/translations/ja-JP.json +13 -1
- package/src/shared/translations/nl-BE.json +13 -1
- package/src/shared/translations/nl-NL.json +13 -1
- package/src/shared/translations/no-NO.json +13 -1
- package/src/shared/translations/pl-PL.json +13 -1
- package/src/shared/translations/pt-PT.json +13 -1
- package/src/shared/translations/sv-SE.json +13 -1
- package/src/shared/types.ts +7 -0
- package/src/shared/utils/localization-util.ts +71 -0
- package/styles/booking-search-results.scss +1 -0
- package/styles/components/_flyin.scss +550 -0
- package/styles/components/_login.scss +133 -0
- package/styles/content-blocks.scss +1 -0
|
@@ -1,55 +1,39 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useRef, useMemo, useCallback } from 'react';
|
|
2
2
|
import { useDispatch, useSelector } from 'react-redux';
|
|
3
3
|
import { QSMRootState } from '../../store/qsm-store';
|
|
4
4
|
import { setFieldValue, setSearchResults, setActiveSearchField, setMobileFilterType, setActiveSearchFieldProps } from '../../store/qsm-slice';
|
|
5
|
-
import QSMConfigurationContext from '../../qsm-configuration-context';
|
|
6
5
|
import useMediaQuery from '../../../shared/utils/use-media-query-util';
|
|
7
6
|
import SearchInput from '../search-input';
|
|
8
7
|
import Icon from '../icon';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const findConfig = (all: FieldConfig[], key: string): BaseFieldConfig | undefined => {
|
|
12
|
-
for (const config of all) {
|
|
13
|
-
if (config.type === 'single' && config.fieldKey === key) {
|
|
14
|
-
return config;
|
|
15
|
-
}
|
|
16
|
-
if (config.type === 'double') {
|
|
17
|
-
const field = (config as DoubleFieldConfig).fields.find((x) => x.fieldKey === key);
|
|
18
|
-
if (field) {
|
|
19
|
-
return field;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return undefined;
|
|
24
|
-
};
|
|
8
|
+
import { BaseFieldConfig, TypeaheadOption, OptionType } from '../../types';
|
|
25
9
|
|
|
26
10
|
interface Props {
|
|
27
|
-
|
|
11
|
+
fieldConfig: BaseFieldConfig;
|
|
28
12
|
enableMobileFilter?: boolean;
|
|
29
13
|
highlightTarget?: string;
|
|
30
14
|
isSecondInput?: boolean;
|
|
31
15
|
isDoubleInput?: boolean;
|
|
32
16
|
readOnlyForced?: boolean;
|
|
17
|
+
isDisabled?: boolean;
|
|
33
18
|
}
|
|
34
19
|
|
|
35
20
|
const SearchInputGroup: React.FC<Props> = ({
|
|
36
|
-
|
|
21
|
+
fieldConfig,
|
|
37
22
|
enableMobileFilter = true,
|
|
38
23
|
highlightTarget = '',
|
|
39
24
|
isSecondInput = false,
|
|
40
25
|
isDoubleInput = false,
|
|
41
|
-
readOnlyForced = false
|
|
26
|
+
readOnlyForced = false,
|
|
27
|
+
isDisabled = false
|
|
42
28
|
}) => {
|
|
43
29
|
const dispatch = useDispatch();
|
|
44
30
|
const ref = useRef<HTMLLabelElement>(null);
|
|
45
31
|
const small = useMediaQuery('(max-width: 768px)');
|
|
46
|
-
|
|
47
|
-
const config = findConfig(searchFields, fieldKey);
|
|
48
|
-
if (!config) {
|
|
32
|
+
if (!fieldConfig) {
|
|
49
33
|
return null;
|
|
50
34
|
}
|
|
51
35
|
|
|
52
|
-
const { label, placeholder, options, autoComplete } =
|
|
36
|
+
const { fieldKey, label, placeholder, options, autoComplete } = fieldConfig;
|
|
53
37
|
|
|
54
38
|
const selector = useMemo(() => (state: QSMRootState) => ((state.qsm as any)[fieldKey] ?? '') as string, [fieldKey]);
|
|
55
39
|
const value = useSelector(selector);
|
|
@@ -80,22 +64,22 @@ const SearchInputGroup: React.FC<Props> = ({
|
|
|
80
64
|
dispatch(setActiveSearchField(fieldKey));
|
|
81
65
|
|
|
82
66
|
// if field has custom onChange (API search)
|
|
83
|
-
if (
|
|
84
|
-
|
|
67
|
+
if (fieldConfig.onChange) {
|
|
68
|
+
fieldConfig.onChange(input);
|
|
85
69
|
return;
|
|
86
70
|
}
|
|
87
71
|
|
|
88
72
|
// fallback to local filtering
|
|
89
73
|
dispatch(setSearchResults(match(input)));
|
|
90
74
|
},
|
|
91
|
-
[dispatch, fieldKey, small, match,
|
|
75
|
+
[dispatch, fieldKey, small, match, fieldConfig]
|
|
92
76
|
);
|
|
93
77
|
|
|
94
78
|
useEffect(() => {
|
|
95
79
|
if (!value || activeSearchField !== fieldKey) return;
|
|
96
80
|
|
|
97
81
|
dispatch(setSearchResults(match(value)));
|
|
98
|
-
}, [options, value, activeSearchField,
|
|
82
|
+
}, [options, value, activeSearchField, fieldConfig, fieldKey]);
|
|
99
83
|
|
|
100
84
|
const handleKeyDown = useCallback(
|
|
101
85
|
(e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
@@ -127,6 +111,8 @@ const SearchInputGroup: React.FC<Props> = ({
|
|
|
127
111
|
);
|
|
128
112
|
|
|
129
113
|
const click = () => {
|
|
114
|
+
if (isDisabled) return;
|
|
115
|
+
|
|
130
116
|
dispatch(setActiveSearchField(fieldKey));
|
|
131
117
|
dispatch(setSearchResults([]));
|
|
132
118
|
if (small && enableMobileFilter) {
|
|
@@ -177,11 +163,12 @@ const SearchInputGroup: React.FC<Props> = ({
|
|
|
177
163
|
id={fieldKey}
|
|
178
164
|
name={fieldKey}
|
|
179
165
|
value={value}
|
|
180
|
-
|
|
166
|
+
disabled={isDisabled}
|
|
167
|
+
readOnly={small || readOnlyForced || isDisabled}
|
|
181
168
|
onFocus={click}
|
|
182
169
|
onClick={(e) => e.stopPropagation()}
|
|
183
170
|
onKeyDown={handleKeyDown}
|
|
184
|
-
onChange={(e) => !small && !readOnlyForced && handleInputChange(e.target.value)}
|
|
171
|
+
onChange={(e) => !small && !readOnlyForced && !isDisabled && handleInputChange(e.target.value)}
|
|
185
172
|
className={`qsm__input${isSecondInput ? ' qsm__input--splittable' : ' u-ps-2'}`}
|
|
186
173
|
placeholder={placeholder}
|
|
187
174
|
/>
|
|
@@ -195,6 +182,7 @@ const SearchInputGroup: React.FC<Props> = ({
|
|
|
195
182
|
label={label}
|
|
196
183
|
isSecondInput={isSecondInput}
|
|
197
184
|
isDoubleInput={isDoubleInput}
|
|
185
|
+
isDisabled={isDisabled}
|
|
198
186
|
/>
|
|
199
187
|
)}
|
|
200
188
|
</label>
|
|
@@ -8,6 +8,7 @@ import { getTranslations } from '../../../shared/utils/localization-util';
|
|
|
8
8
|
|
|
9
9
|
const TravelClassPicker: React.FC = () => {
|
|
10
10
|
const { travelClasses, languageCode } = useContext(QSMConfigurationContext);
|
|
11
|
+
if (!travelClasses || travelClasses.length === 0) return null;
|
|
11
12
|
const translations = getTranslations(languageCode ?? 'en-GB');
|
|
12
13
|
const { selectedTravelClass } = useSelector((state: QSMRootState) => state.qsm);
|
|
13
14
|
|
|
@@ -9,12 +9,12 @@ import TravelTypePicker from '../travel-type-picker';
|
|
|
9
9
|
import Icon from '../icon';
|
|
10
10
|
|
|
11
11
|
const TravelInput: React.FC = () => {
|
|
12
|
-
const
|
|
12
|
+
const dispatch = useDispatch();
|
|
13
|
+
const { askRooms, maxTravelers, defaultTravelers, maxChildAge, maxInfantAge, askTravelType, askTravelClass, languageCode } =
|
|
13
14
|
useContext(QSMConfigurationContext);
|
|
14
|
-
const
|
|
15
|
+
const { adults, kids, babies, rooms, qsmType } = useSelector((state: QSMRootState) => state.qsm);
|
|
16
|
+
const areTravelersInRooms = qsmType !== 'flight' && askRooms;
|
|
15
17
|
|
|
16
|
-
const dispatch = useDispatch();
|
|
17
|
-
const { adults, kids, babies, rooms } = useSelector((state: QSMRootState) => state.qsm);
|
|
18
18
|
const translations = getTranslations(languageCode ?? 'en-GB');
|
|
19
19
|
|
|
20
20
|
const getTravelerButtonClass = (disabled: boolean) => `button button--increment ${disabled ? 'button--disabled' : ''}`;
|
|
@@ -30,12 +30,13 @@ const TravelInputGroup: React.FC = () => {
|
|
|
30
30
|
const isSmallScreen = useMediaQuery('(max-width: 768px)');
|
|
31
31
|
const [isOpen, setIsOpen] = useState(false);
|
|
32
32
|
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
33
|
-
const {
|
|
33
|
+
const { askRooms, defaultTravelers, maxTravelers, languageCode } = useContext(QSMConfigurationContext);
|
|
34
|
+
const { adults, rooms, qsmType } = useSelector((s: QSMRootState) => s.qsm);
|
|
35
|
+
|
|
34
36
|
const translations = getTranslations(languageCode ?? 'en-GB');
|
|
35
37
|
|
|
36
|
-
const areTravelersInRooms =
|
|
38
|
+
const areTravelersInRooms = qsmType !== 'flight' && askRooms;
|
|
37
39
|
|
|
38
|
-
const { adults, rooms } = useSelector((s: QSMRootState) => s.qsm);
|
|
39
40
|
const initDone = useRef(false);
|
|
40
41
|
|
|
41
42
|
const travelerSummary = useSelector((state: QSMRootState) => selectTravelerSummary(state, areTravelersInRooms));
|
|
@@ -8,6 +8,7 @@ import { getTranslations } from '../../../shared/utils/localization-util';
|
|
|
8
8
|
|
|
9
9
|
const TravelNationalityPicker: React.FC = () => {
|
|
10
10
|
const { nationalities, languageCode } = useContext(QSMConfigurationContext);
|
|
11
|
+
if (!nationalities || nationalities.length === 0) return null;
|
|
11
12
|
const translations = getTranslations(languageCode ?? 'en-GB');
|
|
12
13
|
const { selectedNationality } = useSelector((state: QSMRootState) => state.qsm);
|
|
13
14
|
|
|
@@ -8,6 +8,7 @@ import { getTranslations } from '../../../shared/utils/localization-util';
|
|
|
8
8
|
|
|
9
9
|
const TravelTypePicker: React.FC = () => {
|
|
10
10
|
const { travelTypes, languageCode } = useContext(QSMConfigurationContext);
|
|
11
|
+
if (!travelTypes || travelTypes.length === 0) return null;
|
|
11
12
|
const translations = getTranslations(languageCode ?? 'en-GB');
|
|
12
13
|
const { selectedTravelType } = useSelector((state: QSMRootState) => state.qsm);
|
|
13
14
|
|
|
@@ -4,23 +4,10 @@ import { QSMConfiguration } from './types';
|
|
|
4
4
|
const QSMConfigurationContext = React.createContext<QSMConfiguration>({
|
|
5
5
|
type: 'hotel',
|
|
6
6
|
askTravelers: false,
|
|
7
|
-
|
|
7
|
+
askNationality: false,
|
|
8
|
+
askTravelClass: false,
|
|
8
9
|
askTravelType: false,
|
|
9
|
-
|
|
10
|
-
searchFields: [],
|
|
11
|
-
|
|
12
|
-
origins: [],
|
|
13
|
-
originTypeAhead: false,
|
|
14
|
-
onOriginChange: () => {},
|
|
15
|
-
destinations: [],
|
|
16
|
-
destinationTypeAhead: false,
|
|
17
|
-
destinationIcon: '',
|
|
18
|
-
onDestinationChange: () => {},
|
|
19
|
-
|
|
20
|
-
airports: [],
|
|
21
|
-
airportTypeAhead: false,
|
|
22
|
-
airportIcon: '',
|
|
23
|
-
onAirportChange: () => {},
|
|
10
|
+
askRooms: false,
|
|
24
11
|
|
|
25
12
|
travelTypes: [],
|
|
26
13
|
travelTypeIcon: '',
|
|
@@ -29,12 +16,14 @@ const QSMConfigurationContext = React.createContext<QSMConfiguration>({
|
|
|
29
16
|
travelClassIcon: '',
|
|
30
17
|
|
|
31
18
|
nationalities: [],
|
|
19
|
+
dateFlexibility: [],
|
|
32
20
|
|
|
33
21
|
showReturnDate: false,
|
|
34
22
|
datesIcon: '',
|
|
35
23
|
|
|
36
24
|
onSubmit: () => {},
|
|
37
|
-
submitIcon: ''
|
|
25
|
+
submitIcon: '',
|
|
26
|
+
languageCode: ''
|
|
38
27
|
});
|
|
39
28
|
|
|
40
29
|
export default QSMConfigurationContext;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { createSlice, PayloadAction } from '@reduxjs/toolkit';
|
|
2
2
|
|
|
3
|
-
import { MobileFilterType, Room, TravelerType, TravelType, TravelClass, TypeaheadOption } from '../types';
|
|
3
|
+
import { MobileFilterType, Room, TravelerType, TravelType, TravelClass, TypeaheadOption, QsmType } from '../types';
|
|
4
4
|
import { ReactNode } from 'react';
|
|
5
5
|
|
|
6
6
|
export interface QSMState {
|
|
7
|
+
qsmType?: QsmType;
|
|
7
8
|
selectedOrigin?: string;
|
|
8
9
|
selectedDestination?: string;
|
|
9
10
|
selectedAirport?: string;
|
|
@@ -31,6 +32,7 @@ export interface QSMState {
|
|
|
31
32
|
datesIcon?: ReactNode;
|
|
32
33
|
selectedFlexRange?: { before: number; after: number };
|
|
33
34
|
travelTypes: TravelType[];
|
|
35
|
+
tripType: 'oneway' | 'roundtrip' | 'openjaw';
|
|
34
36
|
selectedTravelType?: string;
|
|
35
37
|
travelClasses: TravelClass[];
|
|
36
38
|
selectedTravelClass?: string;
|
|
@@ -47,6 +49,7 @@ export interface QSMState {
|
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
const initialState: QSMState = {
|
|
52
|
+
qsmType: 'hotel-flight',
|
|
50
53
|
selectedOrigin: undefined,
|
|
51
54
|
selectedDestination: undefined,
|
|
52
55
|
selectedAirport: undefined,
|
|
@@ -72,6 +75,7 @@ const initialState: QSMState = {
|
|
|
72
75
|
travelTypes: [],
|
|
73
76
|
selectedTravelType: undefined,
|
|
74
77
|
travelClasses: [],
|
|
78
|
+
tripType: 'roundtrip',
|
|
75
79
|
selectedTravelClass: undefined,
|
|
76
80
|
selectedNationality: undefined,
|
|
77
81
|
defaultTravelers: 2,
|
|
@@ -88,6 +92,9 @@ const qsmSlice = createSlice({
|
|
|
88
92
|
name: 'qsm',
|
|
89
93
|
initialState,
|
|
90
94
|
reducers: {
|
|
95
|
+
setSelectedQsmType: (state, action: PayloadAction<QsmType>) => {
|
|
96
|
+
state.qsmType = action.payload;
|
|
97
|
+
},
|
|
91
98
|
setOrigin: (state, action: PayloadAction<string>) => {
|
|
92
99
|
state.selectedOrigin = action.payload;
|
|
93
100
|
},
|
|
@@ -161,6 +168,9 @@ const qsmSlice = createSlice({
|
|
|
161
168
|
setTravelTypes: (state, action: PayloadAction<TravelType[]>) => {
|
|
162
169
|
state.travelTypes = action.payload;
|
|
163
170
|
},
|
|
171
|
+
setTripType: (state, action: PayloadAction<'oneway' | 'roundtrip' | 'openjaw'>) => {
|
|
172
|
+
state.tripType = action.payload;
|
|
173
|
+
},
|
|
164
174
|
setSelectedTravelType: (state, action) => {
|
|
165
175
|
state.selectedTravelType = action.payload;
|
|
166
176
|
},
|
|
@@ -223,6 +233,7 @@ const qsmSlice = createSlice({
|
|
|
223
233
|
});
|
|
224
234
|
|
|
225
235
|
export const {
|
|
236
|
+
setSelectedQsmType,
|
|
226
237
|
setOrigin,
|
|
227
238
|
setDestination,
|
|
228
239
|
setAirport,
|
|
@@ -239,6 +250,7 @@ export const {
|
|
|
239
250
|
setMaxDate,
|
|
240
251
|
setDateFlexibility,
|
|
241
252
|
setSelectedFlexRange,
|
|
253
|
+
setTripType,
|
|
242
254
|
setTravelTypes,
|
|
243
255
|
setSelectedTravelType,
|
|
244
256
|
setTravelClasses,
|
package/src/qsm/types.ts
CHANGED
|
@@ -1,49 +1,40 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface QSMConfiguration {
|
|
4
|
+
type?: QsmType;
|
|
4
5
|
// Type specification and dedicated parameters
|
|
5
|
-
type: 'hotel' | 'roundTrip' | 'flight';
|
|
6
6
|
askRooms?: boolean; // hotel || roundTrip
|
|
7
7
|
askTravelType?: boolean; // hotel || roundTrip
|
|
8
|
+
allowOneWay?: boolean; // flight
|
|
9
|
+
allowRoundtrip?: boolean; // flight
|
|
8
10
|
allowOpenJaw?: boolean; // flight
|
|
9
11
|
allowMultiCity?: boolean; // flight
|
|
10
12
|
askTravelClass?: boolean; // flight
|
|
11
|
-
allowOneWay?: boolean; // flight
|
|
12
13
|
additionalFilters?: AdditionalFilters; // flight
|
|
13
14
|
askTravelers: boolean;
|
|
14
|
-
|
|
15
|
-
// Fields (form)
|
|
16
|
-
searchFields: FieldConfig[];
|
|
15
|
+
askNationality?: boolean;
|
|
17
16
|
|
|
18
17
|
// Origins and destinations
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
destinationIcon: ReactNode;
|
|
25
|
-
onDestinationChange: (destination: string) => void;
|
|
26
|
-
|
|
27
|
-
// Airports
|
|
28
|
-
airports: Airport[];
|
|
29
|
-
airportTypeAhead: boolean;
|
|
30
|
-
airportIcon: ReactNode;
|
|
31
|
-
onAirportChange: (airport: string) => void;
|
|
18
|
+
departureAirport?: BaseFieldConfig;
|
|
19
|
+
destinationAirport?: BaseFieldConfig;
|
|
20
|
+
returnAirport?: BaseFieldConfig;
|
|
21
|
+
|
|
22
|
+
destination?: BaseFieldConfig;
|
|
32
23
|
|
|
33
24
|
// Travel types
|
|
34
|
-
travelTypes
|
|
35
|
-
travelTypeIcon
|
|
25
|
+
travelTypes?: TravelType[];
|
|
26
|
+
travelTypeIcon?: ReactNode;
|
|
36
27
|
|
|
37
28
|
// Travel classes
|
|
38
|
-
travelClasses
|
|
39
|
-
travelClassIcon
|
|
29
|
+
travelClasses?: TravelClass[];
|
|
30
|
+
travelClassIcon?: ReactNode;
|
|
40
31
|
|
|
41
32
|
// Date flexibility
|
|
42
33
|
dateFlexibility?: DateFlexibility[];
|
|
43
34
|
minDate?: Date;
|
|
44
35
|
maxDate?: Date;
|
|
45
|
-
showReturnDate
|
|
46
|
-
datesIcon
|
|
36
|
+
showReturnDate?: boolean;
|
|
37
|
+
datesIcon?: ReactNode;
|
|
47
38
|
|
|
48
39
|
// Travelers
|
|
49
40
|
defaultTravelers?: number;
|
|
@@ -58,10 +49,13 @@ export interface QSMConfiguration {
|
|
|
58
49
|
languageCode?: string;
|
|
59
50
|
}
|
|
60
51
|
|
|
52
|
+
export type QsmType = 'multidestination' | 'hotel' | 'roundTrip' | 'flight' | 'hotel-flight' | 'package' | 'ticket' | 'car' | 'transfers' | 'cruises';
|
|
53
|
+
|
|
61
54
|
export interface BaseFieldConfig {
|
|
62
55
|
fieldKey: string;
|
|
63
56
|
label: string;
|
|
64
57
|
placeholder: string;
|
|
58
|
+
icon: ReactNode;
|
|
65
59
|
options: TypeaheadOption[];
|
|
66
60
|
autoComplete?: boolean;
|
|
67
61
|
onChange?: (data: any) => void;
|
|
@@ -85,6 +79,7 @@ export interface DoubleFieldConfig {
|
|
|
85
79
|
type: 'double';
|
|
86
80
|
fieldKey: string;
|
|
87
81
|
showReverse?: boolean;
|
|
82
|
+
disableReturnField?: boolean;
|
|
88
83
|
fields: BaseFieldConfig[];
|
|
89
84
|
}
|
|
90
85
|
|
|
@@ -95,21 +90,6 @@ export interface AdditionalFilters {
|
|
|
95
90
|
includeLuggage: boolean;
|
|
96
91
|
}
|
|
97
92
|
|
|
98
|
-
export interface Origin {
|
|
99
|
-
key: string;
|
|
100
|
-
value: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface Destination {
|
|
104
|
-
key: string;
|
|
105
|
-
value: string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface Airport {
|
|
109
|
-
key: string;
|
|
110
|
-
value: string;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
93
|
export interface DateFlexibility {
|
|
114
94
|
name: string;
|
|
115
95
|
before: number;
|