@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
|
@@ -292,6 +292,10 @@
|
|
|
292
292
|
"SORTBY": "Sorter etter",
|
|
293
293
|
"PRICE_ASC": "Pris (lav til høy)",
|
|
294
294
|
"PRICE_DESC": "Pris (høy til lav)",
|
|
295
|
+
"DEPARTURE_TIME_ASC": "Avgangstid stigende",
|
|
296
|
+
"DEPARTURE_TIME_DESC": "Avgangstid synkende",
|
|
297
|
+
"DURATION_ASC": "Varighet stigende",
|
|
298
|
+
"DURATION_DESC": "Varighet synkende",
|
|
295
299
|
"DEPARTURE_ASC": "Avreisedato (nærmeste først)",
|
|
296
300
|
"FILTERS": "Filtre",
|
|
297
301
|
"SHOW_ITINERARY": "Vis reiserute",
|
|
@@ -314,6 +318,14 @@
|
|
|
314
318
|
"STOP_TIME": "Byttetid",
|
|
315
319
|
"ACCOMMODATION": "Overnatting",
|
|
316
320
|
"VIEW_DETAILS": "Se detaljer",
|
|
317
|
-
"NIGHTS": "netter"
|
|
321
|
+
"NIGHTS": "netter",
|
|
322
|
+
"MORNING_RANGE": "Morgen",
|
|
323
|
+
"AFTERNOON_RANGE": "Ettermiddag",
|
|
324
|
+
"EVENING_RANGE": "Kveld",
|
|
325
|
+
"NIGHT_RANGE": "Natt",
|
|
326
|
+
"DEPARTURE_RANGE": "Avgangsperiode",
|
|
327
|
+
"DEPARTURE_AIRPORTS": "Avgangsflyplasser",
|
|
328
|
+
"ARRIVAL_AIRPORTS": "Ankomstflyplasser",
|
|
329
|
+
"PRICE": "Pris"
|
|
318
330
|
}
|
|
319
331
|
}
|
|
@@ -292,6 +292,10 @@
|
|
|
292
292
|
"SORTBY": "Sortuj według",
|
|
293
293
|
"PRICE_ASC": "Cena (od najniższej do najwyższej)",
|
|
294
294
|
"PRICE_DESC": "Cena (od najwyższej do najniższej)",
|
|
295
|
+
"DEPARTURE_TIME_ASC": "Godzina wylotu rosnąco",
|
|
296
|
+
"DEPARTURE_TIME_DESC": "Godzina wylotu malejąco",
|
|
297
|
+
"DURATION_ASC": "Czas trwania rosnąco",
|
|
298
|
+
"DURATION_DESC": "Czas trwania malejąco",
|
|
295
299
|
"DEPARTURE_ASC": "Data wyjazdu (najbliższa najpierw)",
|
|
296
300
|
"FILTERS": "Filtry",
|
|
297
301
|
"SHOW_ITINERARY": "Pokaż plan podróży",
|
|
@@ -314,6 +318,14 @@
|
|
|
314
318
|
"STOP_TIME": "Czas przesiadki",
|
|
315
319
|
"ACCOMMODATION": "Zakwaterowanie",
|
|
316
320
|
"VIEW_DETAILS": "Zobacz szczegóły",
|
|
317
|
-
"NIGHTS": "noce"
|
|
321
|
+
"NIGHTS": "noce",
|
|
322
|
+
"MORNING_RANGE": "Poranek",
|
|
323
|
+
"AFTERNOON_RANGE": "Popołudnie",
|
|
324
|
+
"EVENING_RANGE": "Wieczór",
|
|
325
|
+
"NIGHT_RANGE": "Noc",
|
|
326
|
+
"DEPARTURE_RANGE": "Zakres wylotu",
|
|
327
|
+
"DEPARTURE_AIRPORTS": "Lotniska wylotu",
|
|
328
|
+
"ARRIVAL_AIRPORTS": "Lotniska przylotu",
|
|
329
|
+
"PRICE": "Cena"
|
|
318
330
|
}
|
|
319
331
|
}
|
|
@@ -292,6 +292,10 @@
|
|
|
292
292
|
"SORTBY": "Ordenar por",
|
|
293
293
|
"PRICE_ASC": "Preço (do mais baixo para o mais alto)",
|
|
294
294
|
"PRICE_DESC": "Preço (do mais alto para o mais baixo)",
|
|
295
|
+
"DEPARTURE_TIME_ASC": "Hora de partida crescente",
|
|
296
|
+
"DEPARTURE_TIME_DESC": "Hora de partida decrescente",
|
|
297
|
+
"DURATION_ASC": "Duração crescente",
|
|
298
|
+
"DURATION_DESC": "Duração decrescente",
|
|
295
299
|
"DEPARTURE_ASC": "Data de partida (mais próxima primeiro)",
|
|
296
300
|
"FILTERS": "Filtros",
|
|
297
301
|
"SHOW_ITINERARY": "Mostrar itinerário",
|
|
@@ -314,6 +318,14 @@
|
|
|
314
318
|
"STOP_TIME": "Tempo de escala",
|
|
315
319
|
"ACCOMMODATION": "Alojamento",
|
|
316
320
|
"VIEW_DETAILS": "Ver detalhes",
|
|
317
|
-
"NIGHTS": "noites"
|
|
321
|
+
"NIGHTS": "noites",
|
|
322
|
+
"MORNING_RANGE": "Manhã",
|
|
323
|
+
"AFTERNOON_RANGE": "Tarde",
|
|
324
|
+
"EVENING_RANGE": "Noite",
|
|
325
|
+
"NIGHT_RANGE": "Noite",
|
|
326
|
+
"DEPARTURE_RANGE": "Intervalo de partida",
|
|
327
|
+
"DEPARTURE_AIRPORTS": "Aeroportos de partida",
|
|
328
|
+
"ARRIVAL_AIRPORTS": "Aeroportos de chegada",
|
|
329
|
+
"PRICE": "Preço"
|
|
318
330
|
}
|
|
319
331
|
}
|
|
@@ -292,6 +292,10 @@
|
|
|
292
292
|
"SORTBY": "Sortera efter",
|
|
293
293
|
"PRICE_ASC": "Pris (lågt till högt)",
|
|
294
294
|
"PRICE_DESC": "Pris (högt till lågt)",
|
|
295
|
+
"DEPARTURE_TIME_ASC": "Avgångstid stigande",
|
|
296
|
+
"DEPARTURE_TIME_DESC": "Avgångstid fallande",
|
|
297
|
+
"DURATION_ASC": "Varaktighet stigande",
|
|
298
|
+
"DURATION_DESC": "Varaktighet fallande",
|
|
295
299
|
"DEPARTURE_ASC": "Avresedatum (närmast först)",
|
|
296
300
|
"FILTERS": "Filter",
|
|
297
301
|
"SHOW_ITINERARY": "Visa resplan",
|
|
@@ -314,6 +318,14 @@
|
|
|
314
318
|
"STOP_TIME": "Bytestid",
|
|
315
319
|
"ACCOMMODATION": "Boende",
|
|
316
320
|
"VIEW_DETAILS": "Visa detaljer",
|
|
317
|
-
"NIGHTS": "nätter"
|
|
321
|
+
"NIGHTS": "nätter",
|
|
322
|
+
"MORNING_RANGE": "Morgon",
|
|
323
|
+
"AFTERNOON_RANGE": "Eftermiddag",
|
|
324
|
+
"EVENING_RANGE": "Kväll",
|
|
325
|
+
"NIGHT_RANGE": "Natt",
|
|
326
|
+
"DEPARTURE_RANGE": "Avgångsintervall",
|
|
327
|
+
"DEPARTURE_AIRPORTS": "Avgångsflygplatser",
|
|
328
|
+
"ARRIVAL_AIRPORTS": "Ankomstflygplatser",
|
|
329
|
+
"PRICE": "Pris"
|
|
318
330
|
}
|
|
319
331
|
}
|
package/src/shared/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { arSA, da, de, enGB, es, fr, is, it, nl, nb, pl, pt, sv, ja } from 'date-fns/locale';
|
|
2
|
+
import { format as formatDateFns } from 'date-fns';
|
|
2
3
|
|
|
3
4
|
export const languages = [
|
|
4
5
|
'ar-SA',
|
|
@@ -46,6 +47,8 @@ import plJson from '../translations/pl-PL.json';
|
|
|
46
47
|
import ptJson from '../translations/pt-PT.json';
|
|
47
48
|
import svJson from '../translations/sv-SE.json';
|
|
48
49
|
import jaJson from '../translations/ja-JP.json';
|
|
50
|
+
import { DateStruct } from '@qite/tide-client';
|
|
51
|
+
import { DepartureRange } from '../types';
|
|
49
52
|
|
|
50
53
|
export const getTranslations = (language: string) => {
|
|
51
54
|
switch (language) {
|
|
@@ -168,3 +171,71 @@ export const formatDate = (date: Date) =>
|
|
|
168
171
|
month: 'short',
|
|
169
172
|
year: '2-digit'
|
|
170
173
|
}).format(new Date(date));
|
|
174
|
+
|
|
175
|
+
export const dateToDateStruct = (date: Date | undefined): DateStruct => {
|
|
176
|
+
if (date === undefined) {
|
|
177
|
+
return { year: 0, month: 0, day: 0 };
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
year: date.getFullYear(),
|
|
181
|
+
month: date.getMonth() + 1, // Months are 0-based in JS
|
|
182
|
+
day: date.getDate()
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
export const timeFromDateTime = (dateTime: Date | undefined): string => {
|
|
187
|
+
if (!dateTime) {
|
|
188
|
+
return '';
|
|
189
|
+
}
|
|
190
|
+
const date = new Date(dateTime);
|
|
191
|
+
const hours = date.getHours();
|
|
192
|
+
const minutes = date.getMinutes();
|
|
193
|
+
return `${hours}:${minutes < 10 ? '0' : ''}${minutes}`;
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
export const longFormatDate = (dateTime: Date | undefined, language: string): string => {
|
|
197
|
+
if (!dateTime) {
|
|
198
|
+
return '';
|
|
199
|
+
}
|
|
200
|
+
const locale = getLocale(language);
|
|
201
|
+
const formattedDate = formatDateFns(new Date(dateTime), 'eee dd MMM yy', { locale });
|
|
202
|
+
return formattedDate;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
export const durationTicksInHoursString = (durationInTicks: number): string => {
|
|
206
|
+
const totalMinutes = Math.floor(durationInTicks / 10_000 / 1000 / 60);
|
|
207
|
+
return minutesToHoursString(totalMinutes);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
export const durationInTicksInMinutes = (durationInTicks: number): number => {
|
|
211
|
+
const totalMinutes = Math.floor(durationInTicks / 10_000 / 1000 / 60);
|
|
212
|
+
return totalMinutes;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
export const minutesToHoursString = (totalMinutes: number): string => {
|
|
216
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
217
|
+
const minutes = totalMinutes % 60;
|
|
218
|
+
|
|
219
|
+
const paddedMinutes = minutes.toString().padStart(2, '0');
|
|
220
|
+
|
|
221
|
+
return `${hours.toString()} h ${paddedMinutes}`;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
export const rangeFromDateTimeInMinutes = (dateTime: Date | undefined): DepartureRange => {
|
|
225
|
+
if (!dateTime) {
|
|
226
|
+
return DepartureRange.Morning;
|
|
227
|
+
}
|
|
228
|
+
const date = new Date(dateTime);
|
|
229
|
+
const hours = date.getHours();
|
|
230
|
+
const minutes = hours * 60 + date.getMinutes();
|
|
231
|
+
switch (true) {
|
|
232
|
+
case minutes >= 300 && minutes < 720:
|
|
233
|
+
return DepartureRange.Morning;
|
|
234
|
+
case minutes >= 720 && minutes < 1080:
|
|
235
|
+
return DepartureRange.Afternoon;
|
|
236
|
+
case minutes >= 1080 && minutes < 1440:
|
|
237
|
+
return DepartureRange.Evening;
|
|
238
|
+
default:
|
|
239
|
+
return DepartureRange.Night;
|
|
240
|
+
}
|
|
241
|
+
};
|