@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 CHANGED
@@ -121,6 +121,9 @@ var flightSearchWidgetStyles = `
121
121
  .sw-container h5 {
122
122
  font-size: 14px;
123
123
  }
124
+ .sw-container .font14 {
125
+ font-size: 14px;
126
+ }
124
127
  .sw-container h6,
125
128
  .sw-container small {
126
129
  font-size: 12px;
@@ -868,6 +871,7 @@ padding-inline-start: 25px;
868
871
  flex: 1 1 50%;
869
872
  min-width: 0;
870
873
  justify-content: center;
874
+ border: 1px solid transparent;
871
875
  }
872
876
  .sw-add-return-label label {
873
877
  color: var(--primary) !important;
@@ -1153,17 +1157,17 @@ padding-inline-start: 25px;
1153
1157
  flex: 0 1 auto;
1154
1158
  min-width: fit-content;
1155
1159
  }
1156
- .MobileShow{
1160
+ .sw-container .MobileShow{
1157
1161
  display: none;
1158
1162
  }
1159
- .MobileHide{
1163
+ .sw-container .MobileHide{
1160
1164
  display: block;
1161
1165
  }
1162
1166
  @media screen and (max-width: 768px) {
1163
- .MobileShow{
1167
+ .sw-container .MobileShow{
1164
1168
  display: block;
1165
1169
  }
1166
- .MobileHide{
1170
+ .sw-container .MobileHide{
1167
1171
  display: none;
1168
1172
  }
1169
1173
  .sw-container{
@@ -1345,6 +1349,9 @@ padding-inline-start: 25px;
1345
1349
  .sw-fsrh-chk-main{
1346
1350
  flex-wrap: wrap;
1347
1351
  }
1352
+ .mobiBox{
1353
+ flex-direction: row;
1354
+ }
1348
1355
  }
1349
1356
  `;
1350
1357
 
@@ -2152,12 +2159,34 @@ function FlightSearchWidget({
2152
2159
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `sw-form-field sw-pos-rel${isOrigin ? " br-left" : ""} ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-is-invalid" : ""}`, children: [
2153
2160
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: `${dropdownType}-${segmentIndex}`, children: label }),
2154
2161
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `sw-custom-dropdown ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-has-error" : ""}`, ref: dropdownRef, children: [
2162
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2163
+ "input",
2164
+ {
2165
+ type: "text",
2166
+ readOnly: true,
2167
+ id: `${dropdownType}-${segmentIndex}`,
2168
+ className: `sw-custom-dropdown-trigger MobileShow ${value === placeholder || !value ? "sw-placeholder" : ""}`,
2169
+ value: value === placeholder ? "" : value ?? "",
2170
+ placeholder,
2171
+ onFocus: (e) => {
2172
+ onOpen();
2173
+ e.currentTarget.select();
2174
+ },
2175
+ onClick: (e) => e.currentTarget.select(),
2176
+ onChange: (e) => {
2177
+ const val = e.target.value;
2178
+ handleSegmentFieldChange(segmentIndex, dropdownType, val);
2179
+ triggerSearchAirport(segmentIndex, dropdownType, val);
2180
+ },
2181
+ onKeyDown: (e) => handleKeyDown(e, dropdownType, segmentIndex)
2182
+ }
2183
+ ),
2155
2184
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2156
2185
  "input",
2157
2186
  {
2158
2187
  type: "text",
2159
2188
  id: `${dropdownType}-${segmentIndex}`,
2160
- className: `sw-custom-dropdown-trigger ${value === placeholder || !value ? "sw-placeholder" : ""}`,
2189
+ className: `sw-custom-dropdown-trigger MobileHide ${value === placeholder || !value ? "sw-placeholder" : ""}`,
2161
2190
  value: value === placeholder ? "" : value ?? "",
2162
2191
  placeholder,
2163
2192
  onFocus: (e) => {
@@ -2235,7 +2264,7 @@ function FlightSearchWidget({
2235
2264
  renderAirportDropdown(index, "destination", destinationDropdownRef || destinationRef, isDestOpen, () => toggleSegmentDropdown(index, "destination"))
2236
2265
  ] }, index),
2237
2266
  isMultiCityOrCustom && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-srh-wrap sw-pos-rel", children: [
2238
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-form-field sw-com-cal", children: [
2267
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "sw-form-field sw-com-cal ", children: [
2239
2268
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: `departure-${index}`, children: "Departure" }),
2240
2269
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
2241
2270
  import_calendar.Calendar,
@@ -2354,7 +2383,7 @@ function FlightSearchWidget({
2354
2383
  ),
2355
2384
  renderAirportDropdown(0, "destination", destinationDropdownRef, isDestinationDropdownOpen, () => setIsDestinationDropdownOpen(true))
2356
2385
  ] }),
2357
- (tripType === "round-trip" || tripType === "one-way") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-srh-wrap sw-pos-rel ", children: tripType === "round-trip" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
2386
+ (tripType === "round-trip" || tripType === "one-way") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-srh-wrap sw-pos-rel mobiBox", children: tripType === "round-trip" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
2358
2387
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { cursor: "pointer" }, onClick: () => {
2359
2388
  dateRangeCalendarRef.current?.show?.();
2360
2389
  mobileDateRangeCalendarRef.current?.show?.();
@@ -2539,7 +2568,7 @@ function FlightSearchWidget({
2539
2568
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-form-field sw-pos-rel sw-com-cal sw-add-return-label", style: { cursor: "pointer" }, onClick: () => {
2540
2569
  setTripType("round-trip");
2541
2570
  setTimeout(() => document.getElementById("dateRange")?.querySelector("input")?.focus?.(), 100);
2542
- }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { children: "Add return" }) })
2571
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: "font14", children: "Add return" }) })
2543
2572
  ] }) }),
2544
2573
  (tripType === "multi-city" || tripType === "custom-search") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "sw-srh-mc-foot", children: segments.length < getMaxSegments() && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", { type: "button", className: "sw-srh-add-btn", onClick: addFlightSegment, children: [
2545
2574
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { width: "14", height: "14", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", children: [