@odynn/awayz-flights 0.10.9 → 0.10.11
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/dist/{FlightItinerary-Bn345w_C.js → FlightItinerary-WKjh-sAR.js} +36 -33
- package/dist/components/FlightItinerary/FlightItinerary.js +1 -1
- package/dist/components/FlightItineraryDropdown/FlightItineraryDropdown.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/lib/components/FlightItinerary/FlightItinerary.d.ts +2 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
|
@@ -1,60 +1,63 @@
|
|
|
1
|
-
import { jsx as t, jsxs as a, Fragment as
|
|
2
|
-
import { useAwayzContext as
|
|
3
|
-
import { g as
|
|
4
|
-
import { l as
|
|
1
|
+
import { jsx as t, jsxs as a, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import { useAwayzContext as Y } from "@odynn/awayz-core";
|
|
3
|
+
import { g as S, b as C } from "./dateUtils-Cb9VQiIL.js";
|
|
4
|
+
import { l as E } from "./arrayExtensions-Ce8YopTP.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { h as
|
|
7
|
-
import { useTranslation as
|
|
8
|
-
import { a as
|
|
9
|
-
import './assets/FlightItinerary.css';const
|
|
6
|
+
import { h as l } from "./moment-BGjjqtLQ.js";
|
|
7
|
+
import { useTranslation as N } from "react-i18next";
|
|
8
|
+
import { a as W } from "./index-Kopwbl-x.js";
|
|
9
|
+
import './assets/FlightItinerary.css';const f = (r) => {
|
|
10
10
|
var o;
|
|
11
11
|
if (!r) return "";
|
|
12
12
|
try {
|
|
13
|
-
return (o =
|
|
13
|
+
return (o = E.byIso(r)) == null ? void 0 : o.country;
|
|
14
14
|
} catch (d) {
|
|
15
15
|
return console.error(d), "";
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
var n = /* @__PURE__ */ ((r) => (r.ISO = "dates:iso", r.DISPLAY_SHORT = "dates:displayShort", r.DISPLAY_MEDIUM = "dates:displayMedium", r.DISPLAY_LONG = "dates:displayLong", r.DISPLAY_FULL = "dates:displayFull", r.DISPLAY_SHORT_WITH_YEAR = "dates:displayShortWithYear", r.DISPLAY_MEDIUM_WITH_YEAR = "dates:displayMediumWithYear", r.DISPLAY_LONG_WITH_YEAR = "dates:displayLongWithYear", r.DISPLAY_FULL_WITH_YEAR = "dates:displayFullWithYear", r.DATE_TIME_SHORT = "dates:dateTimeShort", r.DATE_TIME_MEDIUM = "dates:dateTimeMedium", r.DATE_TIME_LONG = "dates:dateTimeLong", r.DATE_TIME_FULL = "dates:dateTimeFull", r.DATE_TIME_SHORT_WITH_YEAR = "dates:dateTimeShortWithYear", r.DATE_TIME_MEDIUM_WITH_YEAR = "dates:dateTimeMediumWithYear", r.DATE_TIME_LONG_WITH_YEAR = "dates:dateTimeLongWithYear", r.DATE_TIME_FULL_WITH_YEAR = "dates:dateTimeFullWithYear", r.TIME_ONLY = "dates:timeOnly", r.TIME_WITH_SECONDS = "dates:timeWithSeconds", r))(n || {});
|
|
19
|
+
const D = ({
|
|
20
|
+
itinerary: r,
|
|
21
|
+
hideCabinClass: o
|
|
22
|
+
}) => {
|
|
23
|
+
const { t: d } = N(), { config: e } = Y();
|
|
24
|
+
return /* @__PURE__ */ t("div", { className: "flight-itinerary", children: r.map((i, A) => {
|
|
25
|
+
var c, _, T, h, m, p, I;
|
|
26
|
+
const s = r[A + 1], L = i.operatingCarrier.logoSymbolUrl ?? i.operatingCarrier.logo ?? ((c = i.marketingCarrier) == null ? void 0 : c.logoSymbolUrl) ?? ((_ = i.marketingCarrier) == null ? void 0 : _.logo), M = ((h = (T = i.passengers[0]) == null ? void 0 : T.cabin) == null ? void 0 : h.marketingName.toLowerCase()) ?? ((m = i.passengers[0]) == null ? void 0 : m.cabinClass);
|
|
27
|
+
return /* @__PURE__ */ a(g, { children: [
|
|
25
28
|
/* @__PURE__ */ a("div", { className: "flight-itinerary-segment", children: [
|
|
26
29
|
/* @__PURE__ */ a("div", { children: [
|
|
27
30
|
/* @__PURE__ */ a("div", { className: "segment-details", children: [
|
|
28
31
|
/* @__PURE__ */ t(
|
|
29
32
|
"img",
|
|
30
33
|
{
|
|
31
|
-
src:
|
|
34
|
+
src: L,
|
|
32
35
|
alt: i.operatingCarrier.name,
|
|
33
|
-
onError: (
|
|
36
|
+
onError: (u) => u.currentTarget.src = (e == null ? void 0 : e.logoFallbackImageUrl) ?? ""
|
|
34
37
|
}
|
|
35
38
|
),
|
|
36
39
|
/* @__PURE__ */ a("div", { children: [
|
|
37
40
|
/* @__PURE__ */ a("p", { children: [
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
l(i.departingAt).format(
|
|
42
|
+
d(n.DATE_TIME_MEDIUM)
|
|
40
43
|
),
|
|
41
44
|
" ",
|
|
42
45
|
"-",
|
|
43
46
|
" ",
|
|
44
|
-
|
|
45
|
-
|
|
47
|
+
l(i.arrivingAt).format(
|
|
48
|
+
d(n.DATE_TIME_MEDIUM)
|
|
46
49
|
)
|
|
47
50
|
] }),
|
|
48
51
|
/* @__PURE__ */ a("div", { className: "flight-locations", children: [
|
|
49
52
|
/* @__PURE__ */ t("p", { children: i.origin.iataCode }),
|
|
50
|
-
/* @__PURE__ */ t(
|
|
53
|
+
/* @__PURE__ */ t(W, {}),
|
|
51
54
|
/* @__PURE__ */ t("p", { children: i.destination.iataCode })
|
|
52
55
|
] })
|
|
53
56
|
] })
|
|
54
57
|
] }),
|
|
55
58
|
/* @__PURE__ */ a("div", { className: "segment-times", children: [
|
|
56
|
-
/* @__PURE__ */ t("p", { children:
|
|
57
|
-
/* @__PURE__ */ t("p", { className: "cabin-class", children:
|
|
59
|
+
/* @__PURE__ */ t("p", { children: S(i.duration) }),
|
|
60
|
+
!o && /* @__PURE__ */ t("p", { className: "cabin-class", children: M })
|
|
58
61
|
] })
|
|
59
62
|
] }),
|
|
60
63
|
/* @__PURE__ */ a("div", { className: "operated-by", children: [
|
|
@@ -64,7 +67,7 @@ const y = ({ itinerary: r }) => {
|
|
|
64
67
|
] }),
|
|
65
68
|
/* @__PURE__ */ a("p", { children: [
|
|
66
69
|
"Aircraft ",
|
|
67
|
-
(
|
|
70
|
+
(p = i.aircraft) == null ? void 0 : p.name,
|
|
68
71
|
" •",
|
|
69
72
|
" ",
|
|
70
73
|
i.operatingCarrier.iataCode,
|
|
@@ -73,20 +76,20 @@ const y = ({ itinerary: r }) => {
|
|
|
73
76
|
] })
|
|
74
77
|
] })
|
|
75
78
|
] }, i.id),
|
|
76
|
-
|
|
79
|
+
s && /* @__PURE__ */ a("div", { className: "flight-itinerary-layover", children: [
|
|
77
80
|
/* @__PURE__ */ a("p", { children: [
|
|
78
81
|
"Layover in",
|
|
79
82
|
" ",
|
|
80
|
-
((
|
|
83
|
+
((I = i.destination.city) == null ? void 0 : I.name) ?? i.destination.cityName,
|
|
81
84
|
", ",
|
|
82
|
-
|
|
85
|
+
f(i.destination.iataCountryCode),
|
|
83
86
|
" ",
|
|
84
87
|
"(",
|
|
85
88
|
i.destination.iataCode,
|
|
86
89
|
")"
|
|
87
90
|
] }),
|
|
88
|
-
/* @__PURE__ */ t("p", { children:
|
|
89
|
-
|
|
91
|
+
/* @__PURE__ */ t("p", { children: C(
|
|
92
|
+
l(s.departingAt).diff(
|
|
90
93
|
i.arrivingAt,
|
|
91
94
|
"minutes"
|
|
92
95
|
)
|
|
@@ -96,6 +99,6 @@ const y = ({ itinerary: r }) => {
|
|
|
96
99
|
}) });
|
|
97
100
|
};
|
|
98
101
|
export {
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
D as F,
|
|
103
|
+
f as g
|
|
101
104
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "@odynn/awayz-core";
|
|
3
3
|
import "../../dateUtils-Cb9VQiIL.js";
|
|
4
|
-
import { F as g } from "../../FlightItinerary-
|
|
4
|
+
import { F as g } from "../../FlightItinerary-WKjh-sAR.js";
|
|
5
5
|
import "../../arrayExtensions-Ce8YopTP.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "../../moment-BGjjqtLQ.js";
|
|
@@ -6,7 +6,7 @@ import "@tanstack/react-query";
|
|
|
6
6
|
import "@odynn/awayz-core";
|
|
7
7
|
import "../../moment-BGjjqtLQ.js";
|
|
8
8
|
import "../../arrayExtensions-Ce8YopTP.js";
|
|
9
|
-
import { F as c } from "../../FlightItinerary-
|
|
9
|
+
import { F as c } from "../../FlightItinerary-WKjh-sAR.js";
|
|
10
10
|
import '../../assets/_styles.css';import '../../assets/FlightItineraryDropdown.css';/* empty css */
|
|
11
11
|
import { MiniFlightItinerary as l } from "../MiniFlightItinerary/MiniFlightItinerary.js";
|
|
12
12
|
import "../../utils/flightUtils.js";
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ISegment } from '@type-op/shared';
|
|
2
2
|
interface FlightItineraryProps {
|
|
3
3
|
itinerary: ISegment[];
|
|
4
|
+
hideCabinClass?: boolean;
|
|
4
5
|
}
|
|
5
|
-
export declare const FlightItinerary: ({ itinerary }: FlightItineraryProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const FlightItinerary: ({ itinerary, hideCabinClass }: FlightItineraryProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFlightSearch as Y } from "./hooks/useFlightSearch/useFlightSearch.js";
|
|
2
2
|
import { useAirportSearch as p } from "./hooks/useAirportSearch/useAirportSearch.js";
|
|
3
3
|
import { EBaggage as l } from "./hooks/useFlightSearch/useFlightSearch.types.js";
|
|
4
|
-
import { F as h, g as f } from "./FlightItinerary-
|
|
4
|
+
import { F as h, g as f } from "./FlightItinerary-WKjh-sAR.js";
|
|
5
5
|
import { FlightItineraryDropdown as S } from "./components/FlightItineraryDropdown/FlightItineraryDropdown.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "react";
|