@travelswitchhq/flight-search-react 1.1.1 → 1.1.3
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 +37 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +37 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -95,6 +95,9 @@ var flightSearchWidgetStyles = `
|
|
|
95
95
|
.sw-container h5 {
|
|
96
96
|
font-size: 14px;
|
|
97
97
|
}
|
|
98
|
+
.sw-container .font14 {
|
|
99
|
+
font-size: 14px;
|
|
100
|
+
}
|
|
98
101
|
.sw-container h6,
|
|
99
102
|
.sw-container small {
|
|
100
103
|
font-size: 12px;
|
|
@@ -842,6 +845,7 @@ padding-inline-start: 25px;
|
|
|
842
845
|
flex: 1 1 50%;
|
|
843
846
|
min-width: 0;
|
|
844
847
|
justify-content: center;
|
|
848
|
+
border: 1px solid transparent;
|
|
845
849
|
}
|
|
846
850
|
.sw-add-return-label label {
|
|
847
851
|
color: var(--primary) !important;
|
|
@@ -1127,17 +1131,17 @@ padding-inline-start: 25px;
|
|
|
1127
1131
|
flex: 0 1 auto;
|
|
1128
1132
|
min-width: fit-content;
|
|
1129
1133
|
}
|
|
1130
|
-
.MobileShow{
|
|
1134
|
+
.sw-container .MobileShow{
|
|
1131
1135
|
display: none;
|
|
1132
1136
|
}
|
|
1133
|
-
.MobileHide{
|
|
1137
|
+
.sw-container .MobileHide{
|
|
1134
1138
|
display: block;
|
|
1135
1139
|
}
|
|
1136
1140
|
@media screen and (max-width: 768px) {
|
|
1137
|
-
.MobileShow{
|
|
1141
|
+
.sw-container .MobileShow{
|
|
1138
1142
|
display: block;
|
|
1139
1143
|
}
|
|
1140
|
-
.MobileHide{
|
|
1144
|
+
.sw-container .MobileHide{
|
|
1141
1145
|
display: none;
|
|
1142
1146
|
}
|
|
1143
1147
|
.sw-container{
|
|
@@ -1319,6 +1323,9 @@ padding-inline-start: 25px;
|
|
|
1319
1323
|
.sw-fsrh-chk-main{
|
|
1320
1324
|
flex-wrap: wrap;
|
|
1321
1325
|
}
|
|
1326
|
+
.mobiBox{
|
|
1327
|
+
flex-direction: row;
|
|
1328
|
+
}
|
|
1322
1329
|
}
|
|
1323
1330
|
`;
|
|
1324
1331
|
|
|
@@ -2126,12 +2133,34 @@ function FlightSearchWidget({
|
|
|
2126
2133
|
return /* @__PURE__ */ jsxs("div", { className: `sw-form-field sw-pos-rel${isOrigin ? " br-left" : ""} ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-is-invalid" : ""}`, children: [
|
|
2127
2134
|
/* @__PURE__ */ jsx("label", { htmlFor: `${dropdownType}-${segmentIndex}`, children: label }),
|
|
2128
2135
|
/* @__PURE__ */ jsxs("div", { className: `sw-custom-dropdown ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-has-error" : ""}`, ref: dropdownRef, children: [
|
|
2136
|
+
/* @__PURE__ */ jsx(
|
|
2137
|
+
"input",
|
|
2138
|
+
{
|
|
2139
|
+
type: "text",
|
|
2140
|
+
readOnly: true,
|
|
2141
|
+
id: `${dropdownType}-${segmentIndex}`,
|
|
2142
|
+
className: `sw-custom-dropdown-trigger MobileShow ${value === placeholder || !value ? "sw-placeholder" : ""}`,
|
|
2143
|
+
value: value === placeholder ? "" : value ?? "",
|
|
2144
|
+
placeholder,
|
|
2145
|
+
onFocus: (e) => {
|
|
2146
|
+
onOpen();
|
|
2147
|
+
e.currentTarget.select();
|
|
2148
|
+
},
|
|
2149
|
+
onClick: (e) => e.currentTarget.select(),
|
|
2150
|
+
onChange: (e) => {
|
|
2151
|
+
const val = e.target.value;
|
|
2152
|
+
handleSegmentFieldChange(segmentIndex, dropdownType, val);
|
|
2153
|
+
triggerSearchAirport(segmentIndex, dropdownType, val);
|
|
2154
|
+
},
|
|
2155
|
+
onKeyDown: (e) => handleKeyDown(e, dropdownType, segmentIndex)
|
|
2156
|
+
}
|
|
2157
|
+
),
|
|
2129
2158
|
/* @__PURE__ */ jsx(
|
|
2130
2159
|
"input",
|
|
2131
2160
|
{
|
|
2132
2161
|
type: "text",
|
|
2133
2162
|
id: `${dropdownType}-${segmentIndex}`,
|
|
2134
|
-
className: `sw-custom-dropdown-trigger ${value === placeholder || !value ? "sw-placeholder" : ""}`,
|
|
2163
|
+
className: `sw-custom-dropdown-trigger MobileHide ${value === placeholder || !value ? "sw-placeholder" : ""}`,
|
|
2135
2164
|
value: value === placeholder ? "" : value ?? "",
|
|
2136
2165
|
placeholder,
|
|
2137
2166
|
onFocus: (e) => {
|
|
@@ -2209,7 +2238,7 @@ function FlightSearchWidget({
|
|
|
2209
2238
|
renderAirportDropdown(index, "destination", destinationDropdownRef || destinationRef, isDestOpen, () => toggleSegmentDropdown(index, "destination"))
|
|
2210
2239
|
] }, index),
|
|
2211
2240
|
isMultiCityOrCustom && /* @__PURE__ */ jsxs("div", { className: "sw-srh-wrap sw-pos-rel", children: [
|
|
2212
|
-
/* @__PURE__ */ jsxs("div", { className: "sw-form-field sw-com-cal", children: [
|
|
2241
|
+
/* @__PURE__ */ jsxs("div", { className: "sw-form-field sw-com-cal ", children: [
|
|
2213
2242
|
/* @__PURE__ */ jsx("label", { htmlFor: `departure-${index}`, children: "Departure" }),
|
|
2214
2243
|
/* @__PURE__ */ jsx(
|
|
2215
2244
|
Calendar,
|
|
@@ -2328,7 +2357,7 @@ function FlightSearchWidget({
|
|
|
2328
2357
|
),
|
|
2329
2358
|
renderAirportDropdown(0, "destination", destinationDropdownRef, isDestinationDropdownOpen, () => setIsDestinationDropdownOpen(true))
|
|
2330
2359
|
] }),
|
|
2331
|
-
(tripType === "round-trip" || tripType === "one-way") && /* @__PURE__ */ jsx("div", { className: "sw-srh-wrap sw-pos-rel ", children: tripType === "round-trip" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2360
|
+
(tripType === "round-trip" || tripType === "one-way") && /* @__PURE__ */ jsx("div", { className: "sw-srh-wrap sw-pos-rel mobiBox", children: tripType === "round-trip" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2332
2361
|
/* @__PURE__ */ jsxs("div", { style: { cursor: "pointer" }, onClick: () => {
|
|
2333
2362
|
dateRangeCalendarRef.current?.show?.();
|
|
2334
2363
|
mobileDateRangeCalendarRef.current?.show?.();
|
|
@@ -2513,7 +2542,7 @@ function FlightSearchWidget({
|
|
|
2513
2542
|
/* @__PURE__ */ jsx("div", { className: "sw-form-field sw-pos-rel sw-com-cal sw-add-return-label", style: { cursor: "pointer" }, onClick: () => {
|
|
2514
2543
|
setTripType("round-trip");
|
|
2515
2544
|
setTimeout(() => document.getElementById("dateRange")?.querySelector("input")?.focus?.(), 100);
|
|
2516
|
-
}, children: /* @__PURE__ */ jsx("label", { children: "Add return" }) })
|
|
2545
|
+
}, children: /* @__PURE__ */ jsx("label", { className: "font14", children: "Add return" }) })
|
|
2517
2546
|
] }) }),
|
|
2518
2547
|
(tripType === "multi-city" || tripType === "custom-search") && /* @__PURE__ */ jsx("div", { className: "sw-srh-mc-foot", children: segments.length < getMaxSegments() && /* @__PURE__ */ jsxs("button", { type: "button", className: "sw-srh-add-btn", onClick: addFlightSegment, children: [
|
|
2519
2548
|
/* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", children: [
|