@qite/tide-components 1.0.4 → 1.0.7
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/index.js +1241 -403
- package/build/build-cjs/src/search-results/components/itinerary/itinerary-utils.d.ts +12 -0
- package/build/build-cjs/src/search-results/components/itinerary/traject-itinerary.d.ts +9 -0
- package/build/build-cjs/src/search-results/components/traject/traject-day-activities-flyin.d.ts +6 -0
- package/build/build-cjs/src/search-results/components/traject/traject-flights-flyin.d.ts +13 -0
- package/build/build-cjs/src/search-results/components/traject/traject-node-card.d.ts +7 -3
- package/build/build-cjs/src/search-results/components/traject/traject-results-flyin.d.ts +6 -0
- package/build/build-cjs/src/search-results/hooks/use-traject-day-activities.d.ts +6 -0
- package/build/build-cjs/src/search-results/store/search-results-slice.d.ts +15 -1
- package/build/build-cjs/src/search-results/types.d.ts +12 -1
- package/build/build-cjs/src/search-results/utils/traject-utils.d.ts +40 -2
- package/build/build-cjs/src/shared/booking/travelers-form.d.ts +1 -0
- package/build/build-esm/index.js +1242 -404
- package/build/build-esm/src/search-results/components/itinerary/itinerary-utils.d.ts +12 -0
- package/build/build-esm/src/search-results/components/itinerary/traject-itinerary.d.ts +9 -0
- package/build/build-esm/src/search-results/components/traject/traject-day-activities-flyin.d.ts +6 -0
- package/build/build-esm/src/search-results/components/traject/traject-flights-flyin.d.ts +13 -0
- package/build/build-esm/src/search-results/components/traject/traject-node-card.d.ts +7 -3
- package/build/build-esm/src/search-results/components/traject/traject-results-flyin.d.ts +6 -0
- package/build/build-esm/src/search-results/hooks/use-traject-day-activities.d.ts +6 -0
- package/build/build-esm/src/search-results/store/search-results-slice.d.ts +15 -1
- package/build/build-esm/src/search-results/types.d.ts +12 -1
- package/build/build-esm/src/search-results/utils/traject-utils.d.ts +40 -2
- package/build/build-esm/src/shared/booking/travelers-form.d.ts +1 -0
- package/package.json +2 -2
- package/styles/booking-search-results-variables.scss +6 -0
- package/styles/components/_search.scss +94 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PackagingEntryLine, PackagingEntryLineFlightLine, PackagingTrajectNode } from '@qite/tide-client';
|
|
2
|
+
export declare const getFlightLines: (flight?: PackagingEntryLine) => PackagingEntryLineFlightLine[];
|
|
3
|
+
export declare const getDepartureTime: (flight?: PackagingEntryLine) => string;
|
|
4
|
+
export declare const getArrivalTime: (flight?: PackagingEntryLine) => string;
|
|
5
|
+
export declare const getDuration: (flight?: PackagingEntryLine) => string;
|
|
6
|
+
export declare const numberOfNights: (segment: PackagingEntryLine) => number;
|
|
7
|
+
/** Icon per service type, so every node on the itinerary reads at a glance. */
|
|
8
|
+
export declare const getServiceTypeIcon: (serviceType?: number) => string;
|
|
9
|
+
export declare const getServiceTypeBadgeModifier: (serviceType?: number) => string;
|
|
10
|
+
export declare const POI_TRAJECT_NODE_TYPE = 2;
|
|
11
|
+
export declare const getTrajectNodeIcon: (node: PackagingTrajectNode) => string;
|
|
12
|
+
export declare const getTrajectNodeBadgeModifier: (node: PackagingTrajectNode) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PackagingEntry, PackagingTrajectResponse } from '@qite/tide-client';
|
|
3
|
+
interface TrajectItineraryProps {
|
|
4
|
+
trajectEntry: PackagingTrajectResponse;
|
|
5
|
+
packagingEntry: PackagingEntry;
|
|
6
|
+
translations: any;
|
|
7
|
+
}
|
|
8
|
+
declare const TrajectItinerary: React.FC<TrajectItineraryProps>;
|
|
9
|
+
export default TrajectItinerary;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface TrajectFlightsFlyInProps {
|
|
3
|
+
isLoading?: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Every flight found for one traject leg, shown in the fly-in.
|
|
7
|
+
*
|
|
8
|
+
* A one-way search can return far more options than belong in the results column, so the column
|
|
9
|
+
* keeps three and hands the rest to this list — the same shape the regular flight results use.
|
|
10
|
+
* Each leg is searched on its own, so the single leg of a result always sits in `outward`.
|
|
11
|
+
*/
|
|
12
|
+
declare const TrajectFlightsFlyIn: React.FC<TrajectFlightsFlyInProps>;
|
|
13
|
+
export default TrajectFlightsFlyIn;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PackagingAccommodationResponse } from '@qite/tide-client';
|
|
3
|
-
import { TrajectNodeWithLine } from '../../utils/traject-utils';
|
|
2
|
+
import { PackagingAccommodationResponse, PackagingTrajectNode } from '@qite/tide-client';
|
|
4
3
|
interface TrajectNodeCardProps {
|
|
5
|
-
|
|
4
|
+
/** The traject node this result answers, where there is one. A suggestion has none. */
|
|
5
|
+
node?: PackagingTrajectNode;
|
|
6
6
|
result: PackagingAccommodationResponse;
|
|
7
7
|
isSelected: boolean;
|
|
8
8
|
languageCode?: string;
|
|
9
9
|
translations: any;
|
|
10
10
|
onSelect: () => void;
|
|
11
|
+
onEditOptions?: () => void;
|
|
11
12
|
showNights?: boolean;
|
|
13
|
+
/** Wording for the button. Defaults to select/selected; suggestions say add/remove instead. */
|
|
14
|
+
selectLabel?: string;
|
|
15
|
+
selectedLabel?: string;
|
|
12
16
|
}
|
|
13
17
|
declare const TrajectNodeCard: React.FC<TrajectNodeCardProps>;
|
|
14
18
|
export default TrajectNodeCard;
|
|
@@ -42,6 +42,9 @@ export interface SearchResultsState {
|
|
|
42
42
|
trajectNodeAvailability: Record<string, TrajectNodeAvailability>;
|
|
43
43
|
/** Per-flight-node one-way search results, keyed by the entry line guid. */
|
|
44
44
|
trajectFlightAvailability: Record<string, TrajectFlightAvailability>;
|
|
45
|
+
trajectDaySuggestions: Record<number, TrajectDaySuggestions>;
|
|
46
|
+
trajectEditLineGuid: string | null;
|
|
47
|
+
trajectActivitiesDayOrder: number | null;
|
|
45
48
|
}
|
|
46
49
|
export type TrajectNodeStatus = 'idle' | 'loading' | 'resolved' | 'unavailable';
|
|
47
50
|
export interface TrajectNodeAvailability {
|
|
@@ -51,6 +54,11 @@ export interface TrajectNodeAvailability {
|
|
|
51
54
|
selectedCode: string | null;
|
|
52
55
|
preferredUnavailable: boolean;
|
|
53
56
|
}
|
|
57
|
+
export interface TrajectDaySuggestions {
|
|
58
|
+
dayOrder: number;
|
|
59
|
+
status: TrajectNodeStatus;
|
|
60
|
+
results: PackagingAccommodationResponse[];
|
|
61
|
+
}
|
|
54
62
|
export interface TrajectFlightAvailability {
|
|
55
63
|
lineGuid: string;
|
|
56
64
|
status: TrajectNodeStatus;
|
|
@@ -85,6 +93,12 @@ export declare const setResults: import("@reduxjs/toolkit").ActionCreatorWithPay
|
|
|
85
93
|
}, "searchResults/setTrajectFlightAvailability">, setTrajectFlightSelection: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
86
94
|
lineGuid: string;
|
|
87
95
|
guid: string;
|
|
88
|
-
}, "searchResults/setTrajectFlightSelection">,
|
|
96
|
+
}, "searchResults/setTrajectFlightSelection">, setTrajectEditLineGuid: import("@reduxjs/toolkit").ActionCreatorWithPayload<string | null, "searchResults/setTrajectEditLineGuid">, setTrajectActivitiesDayOrder: import("@reduxjs/toolkit").ActionCreatorWithPayload<number | null, "searchResults/setTrajectActivitiesDayOrder">, setTrajectDaySuggestionsLoading: import("@reduxjs/toolkit").ActionCreatorWithPayload<number, "searchResults/setTrajectDaySuggestionsLoading">, setTrajectDaySuggestions: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
97
|
+
dayOrder: number;
|
|
98
|
+
results: PackagingAccommodationResponse[];
|
|
99
|
+
}, "searchResults/setTrajectDaySuggestions">, addEditableEntryLines: import("@reduxjs/toolkit").ActionCreatorWithPayload<PackagingEntryLine[], "searchResults/addEditableEntryLines">, updateTrajectNodeResult: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
100
|
+
lineGuid: string;
|
|
101
|
+
result: PackagingAccommodationResponse;
|
|
102
|
+
}, "searchResults/updateTrajectNodeResult">, resetTrajectAvailability: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"searchResults/resetTrajectAvailability">, updateEditableEntryLine: import("@reduxjs/toolkit").ActionCreatorWithPayload<PackagingEntryLine, "searchResults/updateEditableEntryLine">, removeEditableEntryLines: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "searchResults/removeEditableEntryLines">;
|
|
89
103
|
declare const _default: import("@reduxjs/toolkit").Reducer<SearchResultsState>;
|
|
90
104
|
export default _default;
|
|
@@ -39,6 +39,17 @@ export interface SearchResultsConfiguration {
|
|
|
39
39
|
onFlightBook?: (result: ExtendedFlightSearchResponseItem) => void;
|
|
40
40
|
packagingEntry?: PackagingEntry | null;
|
|
41
41
|
trajectEntry?: PackagingTrajectResponse | null;
|
|
42
|
+
/**
|
|
43
|
+
* From the website portal configuration. When true a traject node may also offer externally
|
|
44
|
+
* sourced (API/vendor) hotels and excursions; when false only products held internally in Tide
|
|
45
|
+
* are searched and shown.
|
|
46
|
+
*/
|
|
47
|
+
showApiItems?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* From the website portal configuration. Hides the "show more" button that opens a traject
|
|
50
|
+
* node's remaining results in the fly-in.
|
|
51
|
+
*/
|
|
52
|
+
hideShowMoreResults?: boolean;
|
|
42
53
|
generatePaymentUrl?: boolean;
|
|
43
54
|
entryStatus?: number;
|
|
44
55
|
customEntryStatusId?: number;
|
|
@@ -165,7 +176,7 @@ export type SearchSeed = {
|
|
|
165
176
|
destinationAirport?: string | null;
|
|
166
177
|
rooms: BookingPackageRequestRoom[];
|
|
167
178
|
};
|
|
168
|
-
export type FlyInType = 'flight-outward-results' | 'flight-return-results' | 'flight-details' | 'acco-results' | 'acco-details' | 'excursion-results' | 'excursion-details';
|
|
179
|
+
export type FlyInType = 'flight-outward-results' | 'flight-return-results' | 'flight-details' | 'acco-results' | 'acco-details' | 'excursion-results' | 'excursion-details' | 'traject-flight-results' | 'traject-day-activities';
|
|
169
180
|
export interface ExcursionSearchParams {
|
|
170
181
|
date: string;
|
|
171
182
|
fromDate: string;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { FlightSearchRequest, PackagingAccommodationRequest, PackagingAccommodationResponse, PackagingEntry, PackagingEntryLine, PackagingFlightResponse, PackagingRoom, PackagingTrajectAlternative, PackagingTrajectNode, PackagingTrajectResponse } from '@qite/tide-client';
|
|
1
|
+
import { FlightSearchRequest, TideClientConfig, PackagingAccommodationRequest, PackagingAccommodationResponse, PackagingDestination, PackagingEntry, PackagingEntryLine, PackagingFlightResponse, PackagingRoom, PackagingTrajectAlternative, PackagingTrajectNode, PackagingTrajectResponse } from '@qite/tide-client';
|
|
2
|
+
import { SearchResultsConfiguration } from '../types';
|
|
2
3
|
export declare const REGULAR_TRAJECT_NODE_TYPE = 0;
|
|
3
4
|
export declare const CONNECTING_TRAJECT_NODE_TYPE = 1;
|
|
4
5
|
export interface TrajectNodeWithLine {
|
|
5
6
|
node: PackagingTrajectNode;
|
|
6
7
|
line: PackagingEntryLine;
|
|
8
|
+
lines: PackagingEntryLine[];
|
|
7
9
|
}
|
|
8
10
|
export declare const isSearchableTrajectNode: (node: PackagingTrajectNode) => boolean;
|
|
9
11
|
export declare const isTrajectFlightNode: (node: PackagingTrajectNode) => boolean;
|
|
10
12
|
export declare const getTrajectNodesWithLines: (trajectEntry: PackagingTrajectResponse) => TrajectNodeWithLine[];
|
|
13
|
+
export declare const hasDestination: (destination: PackagingDestination | null) => boolean;
|
|
11
14
|
export interface TrajectSearchContext {
|
|
12
15
|
transactionId: string;
|
|
13
16
|
officeId: number;
|
|
@@ -18,13 +21,48 @@ export interface TrajectSearchContext {
|
|
|
18
21
|
language: string;
|
|
19
22
|
rooms: PackagingAccommodationRequest['rooms'];
|
|
20
23
|
}
|
|
24
|
+
export declare const buildTrajectClientConfig: (context: SearchResultsConfiguration) => TideClientConfig;
|
|
25
|
+
export declare const buildTrajectSearchContext: (context: SearchResultsConfiguration, trajectEntry: PackagingTrajectResponse) => TrajectSearchContext;
|
|
21
26
|
export declare const buildTrajectNodeRequest: ({ node, line }: TrajectNodeWithLine, context: TrajectSearchContext, productCode: string) => PackagingAccommodationRequest;
|
|
27
|
+
export declare const getDayDestinationItem: (items: TrajectNodeWithLine[], dayOrder: number) => TrajectNodeWithLine | null;
|
|
28
|
+
export declare const getDayDestination: (items: TrajectNodeWithLine[], availability: Record<string, {
|
|
29
|
+
results: PackagingAccommodationResponse[];
|
|
30
|
+
selectedCode: string | null;
|
|
31
|
+
}>, dayOrder: number) => PackagingDestination | null;
|
|
32
|
+
export declare const buildTrajectDayExcursionRequest: (date: string, destination: PackagingDestination, context: TrajectSearchContext) => PackagingAccommodationRequest;
|
|
33
|
+
/**
|
|
34
|
+
* Entry lines for an excursion the traveller picked out of the suggestions.
|
|
35
|
+
*
|
|
36
|
+
* A traject node already has its lines and only needs stamping; a suggestion has none, so this
|
|
37
|
+
* builds them — one per selected option, as the regular day-by-day excursion flow does, since an
|
|
38
|
+
* excursion's options are ticket types (adult, child) rather than rooms. Where the search marks no
|
|
39
|
+
* default, the first option of each room stands in.
|
|
40
|
+
*/
|
|
41
|
+
export declare const buildTrajectExcursionLines: (result: PackagingAccommodationResponse) => PackagingEntryLine[];
|
|
42
|
+
export interface DayActivityCard {
|
|
43
|
+
result: PackagingAccommodationResponse;
|
|
44
|
+
/** The traject node this result answers, where it is one of the trip's own excursions. */
|
|
45
|
+
item?: TrajectNodeWithLine;
|
|
46
|
+
}
|
|
47
|
+
export declare const buildDayActivityCards: (items: TrajectNodeWithLine[], availability: Record<string, {
|
|
48
|
+
results: PackagingAccommodationResponse[];
|
|
49
|
+
selectedCode: string | null;
|
|
50
|
+
}>, suggestions: PackagingAccommodationResponse[]) => DayActivityCard[];
|
|
51
|
+
export declare const getConfiguredExcursionCodes: (items: TrajectNodeWithLine[], dayOrder: number) => Set<string>;
|
|
22
52
|
export declare const getNodeCandidates: (node: PackagingTrajectNode) => PackagingTrajectAlternative[];
|
|
23
53
|
export declare const findCandidateForResult: (node: PackagingTrajectNode, result: PackagingAccommodationResponse) => PackagingTrajectAlternative | null;
|
|
24
54
|
export declare const matchesCode: (result: PackagingAccommodationResponse, code: string) => boolean;
|
|
25
55
|
export declare const getPackagingRoomsFromEntry: (entry: PackagingEntry) => PackagingRoom[];
|
|
26
56
|
export declare const pickCheapest: (results: PackagingAccommodationResponse[]) => PackagingAccommodationResponse | null;
|
|
27
|
-
export declare const
|
|
57
|
+
export declare const applyResultToLines: (lines: PackagingEntryLine[], result: PackagingAccommodationResponse) => PackagingEntryLine[];
|
|
58
|
+
export declare const applyResultToLine: (line: PackagingEntryLine, result: PackagingAccommodationResponse, roomIndex?: number) => PackagingEntryLine;
|
|
28
59
|
export declare const buildTrajectFlightRequest: ({ node, line }: TrajectNodeWithLine, context: TrajectSearchContext, pax: FlightSearchRequest["pax"]) => FlightSearchRequest;
|
|
29
60
|
export declare const pickCheapestFlight: (flights: PackagingFlightResponse[]) => PackagingFlightResponse | null;
|
|
30
61
|
export declare const applyFlightToLine: (line: PackagingEntryLine, flight: PackagingFlightResponse) => PackagingEntryLine;
|
|
62
|
+
/**
|
|
63
|
+
* Externally sourced products carry a vendor configuration; products held internally in Tide have
|
|
64
|
+
* none. `vendorType` is not a reliable signal — the packaging service nulls it out when the search
|
|
65
|
+
* configuration has ExposeProvider off — so the vendor ids are what we go on.
|
|
66
|
+
*/
|
|
67
|
+
export declare const isExternalResult: (result: PackagingAccommodationResponse) => boolean;
|
|
68
|
+
export declare const isExternalCandidate: (candidate: PackagingTrajectAlternative) => boolean;
|
|
@@ -39,6 +39,7 @@ export interface SharedTravelersFormProps {
|
|
|
39
39
|
onBookingTypeChange?: (bookingType: string) => void;
|
|
40
40
|
}
|
|
41
41
|
export declare function isBabyAge(age?: number | null, maxBabyAge?: number): boolean;
|
|
42
|
+
export declare function formatBirthDate(birthDate?: string): string;
|
|
42
43
|
export declare function createTraveler(traveler: RoomTraveler, followNumber: {
|
|
43
44
|
number: number;
|
|
44
45
|
}, personTranslation?: string, isCompact?: boolean, maxBabyAge?: number): Traveler;
|