@qite/tide-components 1.0.12 → 1.0.13-preview.0

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.
Files changed (24) hide show
  1. package/build/build-cjs/index.js +2228 -1420
  2. package/build/build-cjs/src/booking-wizard/features/booking/selectors.d.ts +1 -1
  3. package/build/build-cjs/src/booking-wizard/features/travelers-form/validate-form.d.ts +2 -2
  4. package/build/build-cjs/src/booking-wizard/types.d.ts +23 -2
  5. package/build/build-cjs/src/search-results/components/flight/flight-selection/independent-flight-option.d.ts +2 -0
  6. package/build/build-cjs/src/search-results/components/itinerary/index.d.ts +1 -0
  7. package/build/build-cjs/src/search-results/components/itinerary/itinerary-utils.d.ts +1 -0
  8. package/build/build-cjs/src/search-results/types.d.ts +8 -0
  9. package/build/build-cjs/src/search-results/utils/booked-entry-utils.d.ts +20 -0
  10. package/build/build-cjs/src/search-results/utils/traject-utils.d.ts +7 -0
  11. package/build/build-cjs/src/shared/booking/travelers-form.d.ts +13 -8
  12. package/build/build-esm/index.js +2232 -1424
  13. package/build/build-esm/src/booking-wizard/features/booking/selectors.d.ts +1 -1
  14. package/build/build-esm/src/booking-wizard/features/travelers-form/validate-form.d.ts +2 -2
  15. package/build/build-esm/src/booking-wizard/types.d.ts +23 -2
  16. package/build/build-esm/src/search-results/components/flight/flight-selection/independent-flight-option.d.ts +2 -0
  17. package/build/build-esm/src/search-results/components/itinerary/index.d.ts +1 -0
  18. package/build/build-esm/src/search-results/components/itinerary/itinerary-utils.d.ts +1 -0
  19. package/build/build-esm/src/search-results/types.d.ts +8 -0
  20. package/build/build-esm/src/search-results/utils/booked-entry-utils.d.ts +20 -0
  21. package/build/build-esm/src/search-results/utils/traject-utils.d.ts +7 -0
  22. package/build/build-esm/src/shared/booking/travelers-form.d.ts +13 -8
  23. package/package.json +2 -2
  24. package/styles/components/_slider.scss +0 -8
@@ -17,7 +17,7 @@ export declare const selectPackageOptionUnits: (state: RootState) => import("@qi
17
17
  export declare const selectPackageOptionPax: (state: RootState) => import("@qite/tide-client").BookingOptionPax[] | undefined;
18
18
  export declare const selectPackageGroups: (state: RootState) => import("@qite/tide-client").BookingOptionGroup<import("@qite/tide-client").PerBookingPackageOption>[] | undefined;
19
19
  export declare const selectPackageDetails: (state: RootState) => import("@qite/tide-client").BookingPackage | undefined;
20
- export declare const selectPaxCustomFields: (state: RootState) => import("@qite/tide-client").BookingPackagePaxCustomField[];
20
+ export declare const selectPaxFields: (state: RootState) => import("@qite/tide-client").BookingPackagePaxFieldConfig[];
21
21
  export declare const selectPackageFlights: (state: RootState) => {
22
22
  outward: import("@qite/tide-client").BookingPackageFlight[] | undefined;
23
23
  return: import("@qite/tide-client").BookingPackageFlight[] | undefined;
@@ -1,5 +1,5 @@
1
1
  import { FormikErrors } from 'formik';
2
- import { BookingPackagePaxCustomField } from '@qite/tide-client/build/types';
2
+ import { BookingPackagePaxFieldConfig } from '@qite/tide-client/build/types';
3
3
  import { FormField, TravelersFormValues } from '../../types';
4
- declare const validateForm: (values: TravelersFormValues, agentRequired?: boolean, bookingType?: string, translations?: any, formFields?: FormField[], mainBookerFormFields?: FormField[], maxChildAge?: number, maxBabyAge?: number, paxCustomFields?: BookingPackagePaxCustomField[]) => FormikErrors<TravelersFormValues>;
4
+ declare const validateForm: (values: TravelersFormValues, agentRequired?: boolean, bookingType?: string, translations?: any, formFields?: FormField[], mainBookerFormFields?: FormField[], maxChildAge?: number, maxBabyAge?: number, paxFields?: BookingPackagePaxFieldConfig[]) => FormikErrors<TravelersFormValues>;
5
5
  export default validateForm;
@@ -27,8 +27,6 @@ export interface Settings {
27
27
  countries?: Country[];
28
28
  travelersFirstStep?: boolean;
29
29
  showAllCountries?: boolean;
30
- showWeightField?: boolean;
31
- showHeightField?: boolean;
32
30
  };
33
31
  summary: {
34
32
  pathSuffix: string;
@@ -138,6 +136,13 @@ export interface SummaryCheckbox {
138
136
  text: string;
139
137
  isSelected: boolean;
140
138
  }
139
+ export interface TravelerAddress {
140
+ street?: string;
141
+ number?: string;
142
+ postalCode?: string;
143
+ location?: string;
144
+ country?: string;
145
+ }
141
146
  export interface Traveler {
142
147
  id: number;
143
148
  gender: string;
@@ -154,6 +159,22 @@ export interface Traveler {
154
159
  weightType?: number;
155
160
  height?: number | null;
156
161
  heightType?: number;
162
+ nickname?: string;
163
+ birthplace?: string;
164
+ nationality?: string;
165
+ preferredLanguageId?: number;
166
+ email?: string;
167
+ phone?: string;
168
+ mobile?: string;
169
+ passportNumber?: string;
170
+ passportIssueDate?: string;
171
+ passportIssuedLocation?: string;
172
+ passportExpiryDate?: string;
173
+ emergencyNumber?: string;
174
+ hasInsurance?: boolean;
175
+ insuranceName?: string;
176
+ info?: string;
177
+ address?: TravelerAddress;
157
178
  customFields?: BookingPackageCustomField[];
158
179
  }
159
180
  export interface Room {
@@ -9,6 +9,8 @@ interface IndependentFlightOptionProps {
9
9
  showSelectedState?: boolean;
10
10
  currentSelectedPrice?: number;
11
11
  price?: number;
12
+ selectLabel?: string;
13
+ selectedLabel?: string;
12
14
  }
13
15
  declare const IndependentFlightOption: React.FC<IndependentFlightOptionProps>;
14
16
  export default IndependentFlightOption;
@@ -5,6 +5,7 @@ interface ItineraryProps {
5
5
  handleSetIsOpen: () => void;
6
6
  isLoading?: boolean;
7
7
  onEditAccommodation?: (segments: PackagingEntryLine[]) => void;
8
+ onSaveEntry?: () => void;
8
9
  }
9
10
  declare const Itinerary: React.FC<ItineraryProps>;
10
11
  export default Itinerary;
@@ -1,4 +1,5 @@
1
1
  import { PackagingEntryLine, PackagingEntryLineFlightLine, PackagingTrajectNode } from '@qite/tide-client';
2
+ export declare const isMeaningfulItineraryLine: (line: PackagingEntryLine) => boolean;
2
3
  export declare const getFlightLines: (flight?: PackagingEntryLine) => PackagingEntryLineFlightLine[];
3
4
  export declare const getDepartureTime: (flight?: PackagingEntryLine) => string;
4
5
  export declare const getArrivalTime: (flight?: PackagingEntryLine) => string;
@@ -39,6 +39,14 @@ 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. Lets the traveller change an already booked entry
44
+ * opened through its magic link: the entry lands on the day-by-day service cards (the traject
45
+ * results screen) where booked services can be swapped for alternatives and extras added. The
46
+ * booked entry needs `magicLink` set — booking merges changes into the dossier on it. Off by
47
+ * default: without it a booked entry only shows its full itinerary, as before.
48
+ */
49
+ allowBookedEntryChanges?: boolean;
42
50
  /**
43
51
  * From the website portal configuration. When true a traject node may also offer externally
44
52
  * sourced (API/vendor) hotels and excursions; when false only products held internally in Tide
@@ -0,0 +1,20 @@
1
+ import { PackagingAccommodationResponse, PackagingEntry, PackagingEntryLine, PackagingFlightResponse, PackagingTrajectNode, PackagingTrajectResponse } from '@qite/tide-client';
2
+ /**
3
+ * A booked entry opened through its magic link knows nothing about the traject it may once have
4
+ * been composed from — the dossier only keeps the lines. To give it the same day-by-day services
5
+ * screen a traject gets, the traject structure is rebuilt from those lines: every booked service
6
+ * becomes a node whose one "alternative" is the booked product itself, and the days span the trip.
7
+ *
8
+ * The synthesized response keeps the entry untouched (magic link included), which is also how the
9
+ * rest of the component tells this mode apart from a real traject: see isBookedEntryTraject.
10
+ */
11
+ export declare const isBookedEntryTraject: (trajectEntry?: PackagingTrajectResponse | null) => boolean;
12
+ export declare const buildBookedTrajectEntry: (entry: PackagingEntry) => PackagingTrajectResponse;
13
+ /**
14
+ * The card for a booked service when no search result carries it any more (sold out, delisted).
15
+ * Rendered from the line, so the traveller still sees what they booked; price 0 makes the card
16
+ * leave its price out — the paid price lives in the price details, not on the line.
17
+ */
18
+ export declare const buildBookedNodeResult: (node: PackagingTrajectNode, lines: PackagingEntryLine[]) => PackagingAccommodationResponse;
19
+ /** The booked flight as a flight result, so the card that shows it is the card the search results use. */
20
+ export declare const buildBookedFlightResult: (line: PackagingEntryLine) => PackagingFlightResponse;
@@ -74,6 +74,8 @@ export declare const getPackagingRoomsFromEntry: (entry: PackagingEntry) => Pack
74
74
  export declare const pickCheapest: (results: PackagingAccommodationResponse[]) => PackagingAccommodationResponse | null;
75
75
  export declare const applyResultToLines: (lines: PackagingEntryLine[], result: PackagingAccommodationResponse) => PackagingEntryLine[];
76
76
  export declare const applyResultToLine: (line: PackagingEntryLine, result: PackagingAccommodationResponse, roomIndex?: number) => PackagingEntryLine;
77
+ export declare const buildNodeSelectionLines: (item: TrajectNodeWithLine, result: PackagingAccommodationResponse, bookedMode: boolean) => PackagingEntryLine[];
78
+ export declare const buildFlightSelectionLine: (item: TrajectNodeWithLine, flight: PackagingFlightResponse, bookedMode: boolean) => PackagingEntryLine;
77
79
  export declare const buildTrajectFlightRequest: ({ node, line }: TrajectNodeWithLine, context: TrajectSearchContext, pax: FlightSearchRequest["pax"]) => FlightSearchRequest;
78
80
  /**
79
81
  * The entry as the backend can price it.
@@ -87,6 +89,11 @@ export declare const buildTrajectFlightRequest: ({ node, line }: TrajectNodeWith
87
89
  * mapper gave them. This swaps in the guid of whatever each line resolved onto, leaving the
88
90
  * lines the traveller added themselves alone — those were built from a search result and already
89
91
  * carry the right one.
92
+ *
93
+ * A booked entry (the traject was rebuilt from a magic-link entry) is the other way around: its
94
+ * lines live in the dossier under their own guids, and only a line the traveller actually swapped
95
+ * (isChanged) exists in the search cache. Swapping an untouched line's guid would orphan it —
96
+ * the backend drops the dossier line and finds nothing to add — so those keep theirs.
90
97
  */
91
98
  export declare const withCachedEntryLineGuids: (entry: PackagingEntry, trajectEntry: PackagingTrajectResponse, nodeAvailability: Record<string, {
92
99
  results: PackagingAccommodationResponse[];
@@ -1,7 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { FormikProps } from 'formik';
3
3
  import { Country, RoomTraveler, Traveler, TravelersFormValues } from '../../booking-wizard/types';
4
- import { BookingPackageCustomField, BookingPackagePaxCustomField, CountryItem, PackagingEntry, PackagingEntryPax } from '@qite/tide-client';
4
+ import { BookingPackageCustomField, BookingPackagePax, BookingPackagePaxFieldConfig, CountryItem, PackagingEntry, PackagingEntryPax } from '@qite/tide-client';
5
5
  export type TravelersFormField = {
6
6
  type: string;
7
7
  };
@@ -33,9 +33,7 @@ export interface SharedTravelersFormProps {
33
33
  isUnavailable?: boolean;
34
34
  useCompactForm?: boolean;
35
35
  showAllCountries?: boolean;
36
- showWeightField?: boolean;
37
- showHeightField?: boolean;
38
- paxCustomFields?: BookingPackagePaxCustomField[];
36
+ paxFields?: BookingPackagePaxFieldConfig[];
39
37
  showAgentSelection?: boolean;
40
38
  initialShowAgents?: boolean;
41
39
  renderPreviousButton?: () => ReactNode;
@@ -43,15 +41,21 @@ export interface SharedTravelersFormProps {
43
41
  }
44
42
  export declare function isBabyAge(age?: number | null, maxBabyAge?: number): boolean;
45
43
  export declare function formatBirthDate(birthDate?: string): string;
46
- export declare function buildEmptyCustomFields(paxCustomFields?: BookingPackagePaxCustomField[]): BookingPackageCustomField[];
47
- export declare function getApplicablePaxCustomFields(paxCustomFields: BookingPackagePaxCustomField[] | undefined, isMainBooker: boolean): BookingPackagePaxCustomField[];
44
+ export declare function buildEmptyCustomFields(paxFields?: BookingPackagePaxFieldConfig[]): BookingPackageCustomField[];
45
+ export declare function getApplicablePaxCustomFields(paxFields: BookingPackagePaxFieldConfig[] | undefined, isMainBooker: boolean): BookingPackagePaxFieldConfig[];
46
+ export declare function getApplicableBuiltInPaxFields(paxFields: BookingPackagePaxFieldConfig[] | undefined, isMainBooker: boolean): BookingPackagePaxFieldConfig[];
47
+ export declare function getBuiltInPaxField(paxFields: BookingPackagePaxFieldConfig[] | undefined, fieldName: string, isMainBooker: boolean): BookingPackagePaxFieldConfig | undefined;
48
+ export declare const BUILT_IN_FIELD_PATHS: Record<string, string>;
49
+ export declare const CORE_FIELD_NAMES: Set<string>;
50
+ export declare const ADDRESS_FIELD_NAMES: string[];
51
+ export declare function applyTravelerToPax<T extends BookingPackagePax>(pax: T, traveler: Traveler, mainBookerId?: number): T;
48
52
  export declare function createTraveler(traveler: RoomTraveler, followNumber: {
49
53
  number: number;
50
- }, personTranslation?: string, isCompact?: boolean, maxBabyAge?: number, paxCustomFields?: BookingPackagePaxCustomField[]): Traveler;
54
+ }, personTranslation?: string, isCompact?: boolean, maxBabyAge?: number, paxFields?: BookingPackagePaxFieldConfig[]): Traveler;
51
55
  export declare function createInitialValuesFromRooms(formRooms: {
52
56
  adults: RoomTraveler[];
53
57
  children: RoomTraveler[];
54
- }[], startDate?: string, endDate?: string, agentAdressId?: number, personTranslation?: string, isCompact?: boolean, maxBabyAge?: number, paxCustomFields?: BookingPackagePaxCustomField[]): TravelersFormValues;
58
+ }[], startDate?: string, endDate?: string, agentAdressId?: number, personTranslation?: string, isCompact?: boolean, maxBabyAge?: number, paxFields?: BookingPackagePaxFieldConfig[]): TravelersFormValues;
55
59
  export declare function createInitialValuesFromEditablePackagingEntry(editablePackagingEntry: PackagingEntry, agentAdressId?: number): TravelersFormValues;
56
60
  export declare function applyTravelersFormValuesToEditablePackagingEntry(editablePackagingEntry: PackagingEntry, values: TravelersFormValues): {
57
61
  pax: PackagingEntryPax[];
@@ -75,6 +79,7 @@ export declare function applyTravelersFormValuesToEditablePackagingEntry(editabl
75
79
  price: number;
76
80
  depositAmount: number;
77
81
  rooms: import("@qite/tide-client").PackagingEntryRoom[];
82
+ paxFields: BookingPackagePaxFieldConfig[];
78
83
  lines: import("@qite/tide-client").PackagingEntryLine[];
79
84
  status: import("@qite/tide-client").EntryStatus;
80
85
  customStatusId?: number;