@duffel/components 3.5.2 → 3.6.2
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/components/DuffelNGSView/DuffelNGSView.d.ts +3 -3
- package/components/DuffelNGSView/NGSSliceFareCard.d.ts +3 -2
- package/components/DuffelNGSView/NGSTable.d.ts +10 -0
- package/components/DuffelNGSView/lib/group-offers-for-ngs-view.d.ts +6 -3
- package/components/DuffelNGSView/lib/index.d.ts +4 -46
- package/components/DuffelNGSView/lib/sort-ngs-rows.d.ts +2 -0
- package/components/Stays/lib/types.d.ts +7 -0
- package/components/shared/Icon.d.ts +1 -0
- package/custom-elements.js +19 -19
- package/custom-elements.js.map +3 -3
- package/index.d.ts +1 -0
- package/index.js +19 -19
- package/index.js.map +4 -4
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
/// <reference types="@duffel/api" />
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
+
import { Offer } from "@duffel/api/types";
|
|
3
4
|
export interface DuffelNGSViewProps {
|
|
4
|
-
offers:
|
|
5
|
-
sliceIndex: number;
|
|
5
|
+
offers: Offer[];
|
|
6
6
|
onSelect: (offerId: string) => void;
|
|
7
7
|
}
|
|
8
8
|
export declare const DuffelNGSView: React.FC<DuffelNGSViewProps>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
/// <reference types="@duffel/api" />
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
+
import { Offer } from "@duffel/api/types";
|
|
3
4
|
export interface NGSSliceFareCardProps {
|
|
4
|
-
offer:
|
|
5
|
+
offer: Offer;
|
|
5
6
|
sliceIndex: number;
|
|
6
7
|
selected?: boolean;
|
|
7
8
|
onSelect?: () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="@duffel/api" />
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Offer } from "@duffel/api/types";
|
|
4
|
+
export interface NGSTableProps {
|
|
5
|
+
offers: Offer[];
|
|
6
|
+
sliceIndex: number;
|
|
7
|
+
previousSliceKeys: string[];
|
|
8
|
+
onSelect: (offerId: string, sliceKey: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const NGSTable: React.FC<NGSTableProps>;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/// <reference types="@duffel/api" />
|
|
2
|
+
import { Offer, OfferSlice } from "@duffel/api/types";
|
|
3
|
+
import { NGSShelf } from ".";
|
|
4
|
+
export type NGSOfferRow = Record<"slice", OfferSlice> & Record<NGSShelf, Offer[] | null>;
|
|
5
|
+
export declare const getNGSSliceKey: (slice: OfferSlice) => string;
|
|
6
|
+
export declare const groupOffersForNGSView: (offers: Offer[], sliceIndex: number, previousSliceKeys: string[]) => NGSOfferRow[];
|
|
@@ -1,56 +1,14 @@
|
|
|
1
1
|
/// <reference types="@duffel/api" />
|
|
2
2
|
import { IconName } from "@components/shared/Icon";
|
|
3
|
-
import {
|
|
4
|
-
export declare const NGS_SHELVES: readonly [
|
|
5
|
-
export type NGSShelf =
|
|
6
|
-
type SeatWithNGS = {
|
|
7
|
-
type: string;
|
|
8
|
-
flatness: string;
|
|
9
|
-
};
|
|
10
|
-
type CabinWithNGS = {
|
|
11
|
-
amenities: {
|
|
12
|
-
seat: SeatWithNGS;
|
|
13
|
-
power: {
|
|
14
|
-
available: boolean;
|
|
15
|
-
};
|
|
16
|
-
wifi: {
|
|
17
|
-
available: boolean;
|
|
18
|
-
cost: "free" | "paid" | "free or paid" | "n/a";
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
layout: {
|
|
22
|
-
type: string;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
type OfferSliceSegmentPassengerWithNGS = OfferSliceSegmentPassenger & {
|
|
26
|
-
cabin: CabinWithNGS;
|
|
27
|
-
ticket_attributes: {
|
|
28
|
-
advanced_selection_available: boolean;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
export type OfferSliceSegmentWithNGS = OfferSliceSegment & {
|
|
32
|
-
passengers: OfferSliceSegmentPassengerWithNGS[];
|
|
33
|
-
};
|
|
34
|
-
export type OfferSliceWithNGS = OfferSlice & {
|
|
35
|
-
segments: OfferSliceSegmentWithNGS[];
|
|
36
|
-
ngs_shelf: NGSShelf;
|
|
37
|
-
};
|
|
38
|
-
export type OfferWithNGS = Offer & {
|
|
39
|
-
slices: OfferSliceWithNGS[];
|
|
40
|
-
};
|
|
41
|
-
type SeatType = "Standard seat" | "Extra legroom" | "Larger seat" | "Lie flat bed" | "Lie flat suite";
|
|
3
|
+
import { OfferSlice, SeatType } from "@duffel/api/types";
|
|
4
|
+
export declare const NGS_SHELVES: readonly [1, 2, 3, 4, 5];
|
|
5
|
+
export type NGSShelf = OfferSlice["ngs_shelf"];
|
|
42
6
|
type ShelfInfo = {
|
|
43
7
|
short_title: string;
|
|
44
8
|
full_title: string;
|
|
45
9
|
description: string;
|
|
46
|
-
seat: {
|
|
47
|
-
description: SeatType;
|
|
48
|
-
icon: IconName;
|
|
49
|
-
};
|
|
50
|
-
checked_bag: boolean;
|
|
51
|
-
seat_selection: boolean;
|
|
52
10
|
icon: IconName;
|
|
53
11
|
};
|
|
12
|
+
export declare const NGS_SHELF_INFO: Record<OfferSlice["ngs_shelf"], ShelfInfo>;
|
|
54
13
|
export declare const SEAT_ICONS_MAP: Record<SeatType, IconName>;
|
|
55
|
-
export declare const NGS_SHELF_INFO: Record<NGSShelf, ShelfInfo>;
|
|
56
14
|
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Offer } from "@duffel/api/types";
|
|
1
2
|
import { NGSShelf } from ".";
|
|
2
3
|
import { NGSOfferRow } from "./group-offers-for-ngs-view";
|
|
3
4
|
export type SortDirection = "asc" | "desc";
|
|
5
|
+
export declare const getCheapestOfferAmount: (offers: Offer[] | null) => number | null;
|
|
4
6
|
export declare const sortNGSRows: (rows: NGSOfferRow[], sortShelf: NGSShelf, sortDirection: SortDirection) => NGSOfferRow[];
|
|
@@ -18,5 +18,12 @@ export declare const LOYALTY_PROGRAMS_NAME_MAP: {
|
|
|
18
18
|
global_hotel_alliance_discovery: string;
|
|
19
19
|
duffel_hotel_group_rewards: string;
|
|
20
20
|
};
|
|
21
|
+
export declare const SOURCE_NAME_MAP: {
|
|
22
|
+
bookingcom: string;
|
|
23
|
+
expedia: string;
|
|
24
|
+
priceline: string;
|
|
25
|
+
travelport: string;
|
|
26
|
+
duffel_hotel_group: string;
|
|
27
|
+
};
|
|
21
28
|
export declare const getBoardTypeLabel: (boardType: StaysRoomRate["board_type"]) => "Room only, no meals" | "Breakfast included" | "Half board" | "Full board" | "All inclusive";
|
|
22
29
|
export declare const boardTypeIcon: (boardType: StaysRoomRate["board_type"]) => IconName;
|
|
@@ -71,6 +71,7 @@ export declare const ICON_MAP: {
|
|
|
71
71
|
seat: import("react/jsx-runtime").JSX.Element;
|
|
72
72
|
seat_paid_indicator: import("react/jsx-runtime").JSX.Element;
|
|
73
73
|
shield_with_moon: import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
shopfront: import("react/jsx-runtime").JSX.Element;
|
|
74
75
|
shopping_bag: import("react/jsx-runtime").JSX.Element;
|
|
75
76
|
spa: import("react/jsx-runtime").JSX.Element;
|
|
76
77
|
stairs: import("react/jsx-runtime").JSX.Element;
|