@travelswitchhq/flight-search-react 1.2.1 → 1.2.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/dist/index.cjs +27 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +27 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -761,7 +761,7 @@ padding-inline-start: 25px;
|
|
|
761
761
|
gap: 10px;
|
|
762
762
|
width: fit-content;
|
|
763
763
|
margin-top: 15px;
|
|
764
|
-
color: var(--
|
|
764
|
+
color: var(--secondary-bg-text);
|
|
765
765
|
font-size: 14px;
|
|
766
766
|
}
|
|
767
767
|
.sw-advanced-search-options .p-toggleable-content {
|
|
@@ -873,9 +873,6 @@ padding-inline-start: 25px;
|
|
|
873
873
|
max-width: 100%;
|
|
874
874
|
height: auto;
|
|
875
875
|
}
|
|
876
|
-
.sw-container {
|
|
877
|
-
isolation: isolate;
|
|
878
|
-
}
|
|
879
876
|
.sw-srh-grid {
|
|
880
877
|
display: grid;
|
|
881
878
|
grid-template-columns: minmax(200px, 2fr) minmax(100px, 1fr) minmax(80px, 0.6fr) minmax(60px, 0.4fr);
|
|
@@ -1521,6 +1518,7 @@ function FlightSearchWidget({
|
|
|
1521
1518
|
const airlineSearchApiBaseUrl = urls.airline;
|
|
1522
1519
|
const countryCodeConfig = (config?.countryCode ?? "").trim();
|
|
1523
1520
|
const languageCodeConfig = (config?.languageCode ?? "").trim();
|
|
1521
|
+
const currencyCodeConfig = (config?.currency ?? "INR").trim().toUpperCase();
|
|
1524
1522
|
const langCode = languageCodeConfig || "en";
|
|
1525
1523
|
const [airlineQuery, setAirlineQuery] = (0, import_react.useState)("");
|
|
1526
1524
|
const [airlineSuggestions, setAirlineSuggestions] = (0, import_react.useState)([]);
|
|
@@ -1796,6 +1794,29 @@ function FlightSearchWidget({
|
|
|
1796
1794
|
},
|
|
1797
1795
|
[primaryColor, secondaryColor, primaryLightColor, secondaryBgText]
|
|
1798
1796
|
);
|
|
1797
|
+
const isAnyAirportDropdownOpen = (0, import_react.useMemo)(() => {
|
|
1798
|
+
if (isOriginDropdownOpen || isDestinationDropdownOpen || isRoomsGuestsMenuOpen) return true;
|
|
1799
|
+
return Object.values(segmentDropdowns).some(
|
|
1800
|
+
(entry) => Boolean(entry?.origin || entry?.destination)
|
|
1801
|
+
);
|
|
1802
|
+
}, [isOriginDropdownOpen, isDestinationDropdownOpen, isRoomsGuestsMenuOpen, segmentDropdowns]);
|
|
1803
|
+
(0, import_react.useEffect)(() => {
|
|
1804
|
+
if (typeof document === "undefined" || typeof window === "undefined") return;
|
|
1805
|
+
const mobileQuery = window.matchMedia("(max-width: 1024px)");
|
|
1806
|
+
const syncOverflow = () => {
|
|
1807
|
+
if (!mobileQuery.matches) {
|
|
1808
|
+
document.documentElement.style.overflow = "";
|
|
1809
|
+
return;
|
|
1810
|
+
}
|
|
1811
|
+
document.documentElement.style.overflow = isAnyAirportDropdownOpen ? "hidden" : "auto";
|
|
1812
|
+
};
|
|
1813
|
+
syncOverflow();
|
|
1814
|
+
mobileQuery.addEventListener("change", syncOverflow);
|
|
1815
|
+
return () => {
|
|
1816
|
+
mobileQuery.removeEventListener("change", syncOverflow);
|
|
1817
|
+
document.documentElement.style.overflow = "";
|
|
1818
|
+
};
|
|
1819
|
+
}, [isAnyAirportDropdownOpen]);
|
|
1799
1820
|
(0, import_react.useEffect)(() => {
|
|
1800
1821
|
ensureStylesInjected();
|
|
1801
1822
|
ensurePrimeIconsLoaded();
|
|
@@ -2128,7 +2149,7 @@ function FlightSearchWidget({
|
|
|
2128
2149
|
queryStringObj[`airlines`] = advancedOptions.preferredAirlineList.join(",") || "";
|
|
2129
2150
|
queryStringObj[`ref`] = advancedOptions.isRefundable;
|
|
2130
2151
|
queryStringObj[`lc`] = (langCode ?? "en").toUpperCase();
|
|
2131
|
-
queryStringObj[`curr`] =
|
|
2152
|
+
queryStringObj[`curr`] = currencyCodeConfig;
|
|
2132
2153
|
queryStringObj[`mgcc`] = "AE";
|
|
2133
2154
|
queryStringObj["ipc"] = isFlexiDateOption();
|
|
2134
2155
|
queryStringObj[`umrah`] = isUmrahFareOption();
|
|
@@ -2452,7 +2473,7 @@ function FlightSearchWidget({
|
|
|
2452
2473
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-srh-main-head", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-srh-head", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-srh-round-text", children: [
|
|
2453
2474
|
{ value: "round-trip", label: "Round-trip" },
|
|
2454
2475
|
{ value: "one-way", label: "One-way" },
|
|
2455
|
-
{ value: "custom-search", label: "Custom Search" },
|
|
2476
|
+
// { value: "custom-search", label: "Custom Search" },
|
|
2456
2477
|
{ value: "multi-city", label: "Multi-city" }
|
|
2457
2478
|
].map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("label", { className: "sw-tab-checkbox", children: [
|
|
2458
2479
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|