@duffel/components 3.7.5--canary-2 → 3.7.5
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/AirlineSelector.d.ts +2 -0
- package/components/DuffelNGSView/DuffelNGSView.d.ts +6 -0
- package/components/DuffelNGSView/FilterControl.d.ts +2 -0
- package/components/DuffelNGSView/FilterControls.d.ts +1 -0
- package/components/DuffelNGSView/NGSTable.d.ts +6 -1
- package/components/DuffelNGSView/SortingControl.d.ts +22 -0
- package/components/DuffelNGSView/lib/sort-ngs-rows-by-duration.d.ts +1 -1
- package/components/DuffelNGSView/lib/useFilters.d.ts +28 -0
- package/components/shared/Icon.d.ts +1 -0
- package/components/shared/SliceCarriersTitle.d.ts +2 -1
- package/custom-elements.js +5 -5
- package/custom-elements.js.map +2 -2
- package/index.js +19 -19
- package/index.js.map +4 -4
- package/package.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -4,5 +4,7 @@ export interface AirlineSelectorProps {
|
|
|
4
4
|
options: Filters["airlines"];
|
|
5
5
|
selected: Filters["airlines"];
|
|
6
6
|
onChange: (airlines: Filters["airlines"]) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
targetLabel?: string;
|
|
7
9
|
}
|
|
8
10
|
export declare const AirlineSelector: React.FC<AirlineSelectorProps>;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/// <reference types="@duffel/api" />
|
|
2
2
|
import { OfferRequest } from "@duffel/api/types";
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
import { NGSOfferRow } from "./lib/group-offers-for-ngs-view";
|
|
5
|
+
export declare function useSort(): {
|
|
6
|
+
sortOption: "duration-asc" | "duration-desc" | "1-asc" | "1-desc" | "2-asc" | "2-desc" | "3-asc" | "3-desc" | "4-asc" | "4-desc" | "5-asc" | "5-desc";
|
|
7
|
+
setSortOption: React.Dispatch<React.SetStateAction<"duration-asc" | "duration-desc" | "1-asc" | "1-desc" | "2-asc" | "2-desc" | "3-asc" | "3-desc" | "4-asc" | "4-desc" | "5-asc" | "5-desc">>;
|
|
8
|
+
sortingFunction: (rows: NGSOfferRow[]) => NGSOfferRow[];
|
|
9
|
+
};
|
|
4
10
|
export interface DuffelNGSViewProps {
|
|
5
11
|
offerRequest: OfferRequest;
|
|
6
12
|
onSelect: (offerId: string) => void;
|
|
@@ -2,6 +2,8 @@ import React from "react";
|
|
|
2
2
|
interface FilterControlProps {
|
|
3
3
|
target: React.ReactNode;
|
|
4
4
|
children: (closePopover: () => void) => React.ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
popoverWidth?: string;
|
|
5
7
|
}
|
|
6
8
|
export declare const FilterControl: React.FC<FilterControlProps>;
|
|
7
9
|
interface FilterControlOptionProps {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/// <reference types="@duffel/api" />
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import { NGSShelf } from "./lib";
|
|
4
|
+
import { NGSOfferRow } from "./lib/group-offers-for-ngs-view";
|
|
3
5
|
import { OfferRequest } from "@duffel/api/types";
|
|
4
6
|
export interface NGSTableProps {
|
|
5
7
|
offers: OfferRequest["offers"];
|
|
6
8
|
sliceIndex: number;
|
|
7
9
|
previousSliceKeys: string[];
|
|
8
|
-
onSelect: (offerId: string, sliceKey: string) => void;
|
|
10
|
+
onSelect: (offerId: string, sliceKey: string, offer: OfferRequest["offers"][number]) => void;
|
|
11
|
+
sortingFunction: (rows: NGSOfferRow[]) => NGSOfferRow[];
|
|
12
|
+
selectedColumn: NGSShelf | null;
|
|
13
|
+
setSelectedColumn: (shelf: NGSShelf | null) => void;
|
|
9
14
|
}
|
|
10
15
|
export declare const NGSTable: React.FC<NGSTableProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const OPTIONS: {
|
|
3
|
+
readonly "duration-asc": "Duration (shortest to longest)";
|
|
4
|
+
readonly "duration-desc": "Duration (longest to shortest)";
|
|
5
|
+
readonly "1-asc": "Price on Basic shelf (low to high)";
|
|
6
|
+
readonly "1-desc": "Price on Basic shelf (high to low)";
|
|
7
|
+
readonly "2-asc": "Price on Standard shelf (low to high)";
|
|
8
|
+
readonly "2-desc": "Price on Standard shelf (high to low)";
|
|
9
|
+
readonly "3-asc": "Price on Plus shelf (low to high)";
|
|
10
|
+
readonly "3-desc": "Price on Plus shelf (high to low)";
|
|
11
|
+
readonly "4-asc": "Price on Premium shelf (low to high)";
|
|
12
|
+
readonly "4-desc": "Price on Premium shelf (high to low)";
|
|
13
|
+
readonly "5-asc": "Price on Luxury shelf (low to high)";
|
|
14
|
+
readonly "5-desc": "Price on Luxury shelf (high to low)";
|
|
15
|
+
};
|
|
16
|
+
export type SortOption = keyof typeof OPTIONS;
|
|
17
|
+
interface StopsSelectorProps {
|
|
18
|
+
selected: SortOption;
|
|
19
|
+
onChange: (stopFilter: SortOption) => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const SortingControl: React.FC<StopsSelectorProps>;
|
|
22
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NGSOfferRow } from "./group-offers-for-ngs-view";
|
|
2
2
|
type DurationSortDirection = "asc" | "desc";
|
|
3
3
|
export type DurationSort = DurationSortDirection | null;
|
|
4
|
-
export declare const sortNGSRowsByDuration: (rows: NGSOfferRow[],
|
|
4
|
+
export declare const sortNGSRowsByDuration: (rows: NGSOfferRow[], sortDirection: DurationSortDirection) => NGSOfferRow[];
|
|
5
5
|
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="@duffel/api" />
|
|
2
|
+
import { OfferRequest } from "@duffel/api/types";
|
|
3
|
+
export declare function useFilters(offerRequest: OfferRequest, selectedSliceKeys: string[]): {
|
|
4
|
+
airlinesFilterOptions: {
|
|
5
|
+
iata_code: string;
|
|
6
|
+
name: string;
|
|
7
|
+
}[];
|
|
8
|
+
airlinesFilter: {
|
|
9
|
+
iata_code: string;
|
|
10
|
+
name: string;
|
|
11
|
+
}[];
|
|
12
|
+
timesFilter: {
|
|
13
|
+
departure: [number, number];
|
|
14
|
+
arrival: [number, number];
|
|
15
|
+
};
|
|
16
|
+
stopsFilter: "direct-only" | "1-stop-at-most" | "2-stops-at-most" | "any";
|
|
17
|
+
setAirlinesFilter: import("react").Dispatch<import("react").SetStateAction<{
|
|
18
|
+
iata_code: string;
|
|
19
|
+
name: string;
|
|
20
|
+
}[]>>;
|
|
21
|
+
setTimesFilter: import("react").Dispatch<import("react").SetStateAction<{
|
|
22
|
+
departure: [number, number];
|
|
23
|
+
arrival: [number, number];
|
|
24
|
+
}>>;
|
|
25
|
+
setStopsFilter: import("react").Dispatch<import("react").SetStateAction<"direct-only" | "1-stop-at-most" | "2-stops-at-most" | "any">>;
|
|
26
|
+
clearFilters: () => void;
|
|
27
|
+
filteredOffers: Omit<import("@duffel/api/types").Offer, "available_services">[];
|
|
28
|
+
};
|
|
@@ -12,6 +12,7 @@ export declare const ICON_MAP: {
|
|
|
12
12
|
airplane_ticket: import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
apartment: import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
arrow_downward: import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
arrow_drop_down: import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
arrow_forward: import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
arrow_left: import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
arrow_right: import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="@duffel/api" />
|
|
2
|
-
import { OfferSlice } from "@duffel/api/types";
|
|
2
|
+
import { OfferSlice, OfferSliceSegment } from "@duffel/api/types";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
export interface SliceCarriersTitleProps {
|
|
5
5
|
slice: OfferSlice;
|
|
6
6
|
}
|
|
7
7
|
export declare const SliceCarriersTitle: React.FC<SliceCarriersTitleProps>;
|
|
8
|
+
export declare function getSegmentCarriersTitle(segment: OfferSliceSegment): string;
|