@qite/tide-booking-component 1.4.33 → 1.4.34

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/src/qsm/types.ts CHANGED
@@ -1,145 +1,145 @@
1
- import { ReactNode } from 'react';
2
-
3
- export interface QSMConfiguration {
4
- // Type specification and dedicated parameters
5
- type: 'hotel' | 'roundTrip' | 'flight';
6
- askRooms?: boolean; // hotel || roundTrip
7
- askTravelType?: boolean; // hotel || roundTrip
8
- allowOpenJaw?: boolean; // flight
9
- allowMultiCity?: boolean; // flight
10
- askTravelClass?: boolean; // flight
11
- allowOneWay?: boolean; // flight
12
- additionalFilters?: AdditionalFilters; // flight
13
- askTravelers: boolean;
14
-
15
- // Fields (form)
16
- searchFields: FieldConfig[];
17
-
18
- // Origins and destinations
19
- origins: Origin[];
20
- originTypeAhead: boolean;
21
- onOriginChange: (origin: string) => void;
22
- destinations: Destination[];
23
- destinationTypeAhead: boolean;
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;
32
-
33
- // Travel types
34
- travelTypes: TravelType[];
35
- travelTypeIcon: ReactNode;
36
-
37
- // Travel classes
38
- travelClasses: TravelClass[];
39
- travelClassIcon: ReactNode;
40
-
41
- // Date flexibility
42
- dateFlexibility?: DateFlexibility[];
43
- minDate?: Date;
44
- maxDate?: Date;
45
- showReturnDate: boolean;
46
- datesIcon: ReactNode;
47
-
48
- // Travelers
49
- defaultTravelers?: number;
50
- maxTravelers?: number;
51
- maxChildAge?: number;
52
- maxInfantAge?: number;
53
-
54
- onSubmit: (data: any) => void;
55
- submitLabel: string;
56
- submitIcon: ReactNode;
57
-
58
- nationalities: Nationality[];
59
- languageCode?: string;
60
- }
61
-
62
- export interface BaseFieldConfig {
63
- fieldKey: string;
64
- label: string;
65
- placeholder: string;
66
- options: TypeaheadOption[];
67
- autoComplete?: boolean;
68
- }
69
-
70
- export interface TypeaheadOption {
71
- key: string;
72
- value: string;
73
- iataCode?: string;
74
- country?: string;
75
- type: OptionType;
76
- }
77
-
78
- export type OptionType = 'country' | 'region' | 'oord' | 'location' | 'airport' | 'hotel' | 'other';
79
-
80
- export interface SingleFieldConfig extends BaseFieldConfig {
81
- type: 'single';
82
- }
83
-
84
- export interface DoubleFieldConfig {
85
- type: 'double';
86
- fieldKey: string;
87
- showReverse?: boolean;
88
- fields: BaseFieldConfig[];
89
- }
90
-
91
- export type FieldConfig = SingleFieldConfig | DoubleFieldConfig;
92
-
93
- export interface AdditionalFilters {
94
- showDirectFlights: boolean;
95
- includeLuggage: boolean;
96
- }
97
-
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
- export interface DateFlexibility {
114
- name: string;
115
- before: number;
116
- after: number;
117
- }
118
-
119
- export type MobileFilterType = 'search' | 'date' | 'traveler' | null;
120
-
121
- export type TravelerType = 'adults' | 'kids' | 'babies';
122
-
123
- export interface Room {
124
- adults: number;
125
- kids: number;
126
- babies: number;
127
- }
128
-
129
- export interface TravelType {
130
- id: number;
131
- label: string;
132
- icon?: ReactNode;
133
- }
134
-
135
- export interface TravelClass {
136
- id: number;
137
- label: string;
138
- icon?: ReactNode;
139
- }
140
-
141
- export interface Nationality {
142
- id: number;
143
- label: string;
144
- icon?: ReactNode;
145
- }
1
+ import { ReactNode } from 'react';
2
+
3
+ export interface QSMConfiguration {
4
+ // Type specification and dedicated parameters
5
+ type: 'hotel' | 'roundTrip' | 'flight';
6
+ askRooms?: boolean; // hotel || roundTrip
7
+ askTravelType?: boolean; // hotel || roundTrip
8
+ allowOpenJaw?: boolean; // flight
9
+ allowMultiCity?: boolean; // flight
10
+ askTravelClass?: boolean; // flight
11
+ allowOneWay?: boolean; // flight
12
+ additionalFilters?: AdditionalFilters; // flight
13
+ askTravelers: boolean;
14
+
15
+ // Fields (form)
16
+ searchFields: FieldConfig[];
17
+
18
+ // Origins and destinations
19
+ origins: Origin[];
20
+ originTypeAhead: boolean;
21
+ onOriginChange: (origin: string) => void;
22
+ destinations: Destination[];
23
+ destinationTypeAhead: boolean;
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;
32
+
33
+ // Travel types
34
+ travelTypes: TravelType[];
35
+ travelTypeIcon: ReactNode;
36
+
37
+ // Travel classes
38
+ travelClasses: TravelClass[];
39
+ travelClassIcon: ReactNode;
40
+
41
+ // Date flexibility
42
+ dateFlexibility?: DateFlexibility[];
43
+ minDate?: Date;
44
+ maxDate?: Date;
45
+ showReturnDate: boolean;
46
+ datesIcon: ReactNode;
47
+
48
+ // Travelers
49
+ defaultTravelers?: number;
50
+ maxTravelers?: number;
51
+ maxChildAge?: number;
52
+ maxInfantAge?: number;
53
+
54
+ onSubmit: (data: any) => void;
55
+ submitLabel: string;
56
+ submitIcon: ReactNode;
57
+
58
+ nationalities: Nationality[];
59
+ languageCode?: string;
60
+ }
61
+
62
+ export interface BaseFieldConfig {
63
+ fieldKey: string;
64
+ label: string;
65
+ placeholder: string;
66
+ options: TypeaheadOption[];
67
+ autoComplete?: boolean;
68
+ }
69
+
70
+ export interface TypeaheadOption {
71
+ key: string;
72
+ value: string;
73
+ iataCode?: string;
74
+ country?: string;
75
+ type: OptionType;
76
+ }
77
+
78
+ export type OptionType = 'country' | 'region' | 'oord' | 'location' | 'airport' | 'hotel' | 'other';
79
+
80
+ export interface SingleFieldConfig extends BaseFieldConfig {
81
+ type: 'single';
82
+ }
83
+
84
+ export interface DoubleFieldConfig {
85
+ type: 'double';
86
+ fieldKey: string;
87
+ showReverse?: boolean;
88
+ fields: BaseFieldConfig[];
89
+ }
90
+
91
+ export type FieldConfig = SingleFieldConfig | DoubleFieldConfig;
92
+
93
+ export interface AdditionalFilters {
94
+ showDirectFlights: boolean;
95
+ includeLuggage: boolean;
96
+ }
97
+
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
+ export interface DateFlexibility {
114
+ name: string;
115
+ before: number;
116
+ after: number;
117
+ }
118
+
119
+ export type MobileFilterType = 'search' | 'date' | 'traveler' | null;
120
+
121
+ export type TravelerType = 'adults' | 'kids' | 'babies';
122
+
123
+ export interface Room {
124
+ adults: number;
125
+ kids: number;
126
+ babies: number;
127
+ }
128
+
129
+ export interface TravelType {
130
+ id: number;
131
+ label: string;
132
+ icon?: ReactNode;
133
+ }
134
+
135
+ export interface TravelClass {
136
+ id: number;
137
+ label: string;
138
+ icon?: ReactNode;
139
+ }
140
+
141
+ export interface Nationality {
142
+ id: number;
143
+ label: string;
144
+ icon?: ReactNode;
145
+ }