@duffel/components 3.5.2 → 3.6.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.
- 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 +3 -45
- package/custom-elements.js +2 -2
- package/custom-elements.js.map +1 -1
- 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 [
|
|
3
|
+
import { OfferSlice, SeatType } from "@duffel/api/types";
|
|
4
|
+
export declare const NGS_SHELVES: readonly [1, 2, 3, 4, 5];
|
|
5
5
|
export type NGSShelf = (typeof NGS_SHELVES)[number];
|
|
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";
|
|
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 {};
|