@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.
@@ -1,60 +1,63 @@
1
- import { jsx as t, jsxs as a, Fragment as u } from "react/jsx-runtime";
2
- import { useAwayzContext as g } from "@odynn/awayz-core";
3
- import { g as Y, b as S } from "./dateUtils-Cb9VQiIL.js";
4
- import { l as C } from "./arrayExtensions-Ce8YopTP.js";
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 e } from "./moment-BGjjqtLQ.js";
7
- import { useTranslation as E } from "react-i18next";
8
- import { a as N } from "./index-Kopwbl-x.js";
9
- import './assets/FlightItinerary.css';const W = (r) => {
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 = C.byIso(r)) == null ? void 0 : o.country;
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 l = /* @__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))(l || {});
19
- const y = ({ itinerary: r }) => {
20
- const { t: o } = E(), { config: d } = g();
21
- return /* @__PURE__ */ t("div", { className: "flight-itinerary", children: r.map((i, I) => {
22
- var s, c, _, T, h, m, p;
23
- const n = r[I + 1], A = i.operatingCarrier.logoSymbolUrl ?? i.operatingCarrier.logo ?? ((s = i.marketingCarrier) == null ? void 0 : s.logoSymbolUrl) ?? ((c = i.marketingCarrier) == null ? void 0 : c.logo), L = ((T = (_ = i.passengers[0]) == null ? void 0 : _.cabin) == null ? void 0 : T.marketingName.toLowerCase()) ?? ((h = i.passengers[0]) == null ? void 0 : h.cabinClass);
24
- return /* @__PURE__ */ a(u, { children: [
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: A,
34
+ src: L,
32
35
  alt: i.operatingCarrier.name,
33
- onError: (M) => M.currentTarget.src = (d == null ? void 0 : d.logoFallbackImageUrl) ?? ""
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
- e(i.departingAt).format(
39
- o(l.DATE_TIME_MEDIUM)
41
+ l(i.departingAt).format(
42
+ d(n.DATE_TIME_MEDIUM)
40
43
  ),
41
44
  " ",
42
45
  "-",
43
46
  " ",
44
- e(i.arrivingAt).format(
45
- o(l.DATE_TIME_MEDIUM)
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(N, {}),
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: Y(i.duration) }),
57
- /* @__PURE__ */ t("p", { className: "cabin-class", children: L })
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
- (m = i.aircraft) == null ? void 0 : m.name,
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
- n && /* @__PURE__ */ a("div", { className: "flight-itinerary-layover", children: [
79
+ s && /* @__PURE__ */ a("div", { className: "flight-itinerary-layover", children: [
77
80
  /* @__PURE__ */ a("p", { children: [
78
81
  "Layover in",
79
82
  " ",
80
- ((p = i.destination.city) == null ? void 0 : p.name) ?? i.destination.cityName,
83
+ ((I = i.destination.city) == null ? void 0 : I.name) ?? i.destination.cityName,
81
84
  ", ",
82
- W(i.destination.iataCountryCode),
85
+ f(i.destination.iataCountryCode),
83
86
  " ",
84
87
  "(",
85
88
  i.destination.iataCode,
86
89
  ")"
87
90
  ] }),
88
- /* @__PURE__ */ t("p", { children: S(
89
- e(n.departingAt).diff(
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
- y as F,
100
- W as g
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-Bn345w_C.js";
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-Bn345w_C.js";
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";
@@ -1,4 +1,4 @@
1
- import { F as e } from "../FlightItinerary-Bn345w_C.js";
1
+ import { F as e } from "../FlightItinerary-WKjh-sAR.js";
2
2
  import { FlightItineraryDropdown as n } from "./FlightItineraryDropdown/FlightItineraryDropdown.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
@@ -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-Bn345w_C.js";
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odynn/awayz-flights",
3
- "version": "0.10.9",
3
+ "version": "0.10.11",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"