@travelswitchhq/flight-search-react 1.1.6 → 1.1.8
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 +20 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +20 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -43,7 +43,6 @@ var flightSearchWidgetStyles = `
|
|
|
43
43
|
position: relative;
|
|
44
44
|
display: block;
|
|
45
45
|
width: 100%;
|
|
46
|
-
min-width: 1240px;
|
|
47
46
|
margin: 0;
|
|
48
47
|
padding: 0;
|
|
49
48
|
box-sizing: border-box;
|
|
@@ -161,7 +160,7 @@ var flightSearchWidgetStyles = `
|
|
|
161
160
|
.sw-com-cal .p-disabled{
|
|
162
161
|
opacity: 0.3;
|
|
163
162
|
}
|
|
164
|
-
.sw-form-field {
|
|
163
|
+
.sw-srh-form-field {
|
|
165
164
|
display: flex;
|
|
166
165
|
flex-direction: column;
|
|
167
166
|
flex: 1 1 auto;
|
|
@@ -171,10 +170,10 @@ var flightSearchWidgetStyles = `
|
|
|
171
170
|
min-width: 0;
|
|
172
171
|
overflow: visible;
|
|
173
172
|
}
|
|
174
|
-
.sw-form-
|
|
173
|
+
.sw-srh-form-fieldsw-is-invalid {
|
|
175
174
|
box-shadow: inset 0 0 0 1px var(--sw-error);
|
|
176
175
|
}
|
|
177
|
-
.sw-form-
|
|
176
|
+
.sw-srh-form-fieldsw-is-invalid label {
|
|
178
177
|
color: var(--sw-error);
|
|
179
178
|
}
|
|
180
179
|
.sw-custom-dropdown.sw-has-error .sw-custom-dropdown-trigger {
|
|
@@ -200,8 +199,8 @@ var flightSearchWidgetStyles = `
|
|
|
200
199
|
.p-button-label {
|
|
201
200
|
flex: unset;
|
|
202
201
|
}
|
|
203
|
-
.sw-form-field input,
|
|
204
|
-
.sw-form-field .p-inputtext {
|
|
202
|
+
.sw-srh-form-field input,
|
|
203
|
+
.sw-srh-form-field .p-inputtext {
|
|
205
204
|
display: block;
|
|
206
205
|
width: 100%;
|
|
207
206
|
margin: 0;
|
|
@@ -215,8 +214,8 @@ var flightSearchWidgetStyles = `
|
|
|
215
214
|
font-size: 14px;
|
|
216
215
|
font-weight: 500;
|
|
217
216
|
}
|
|
218
|
-
.sw-form-field input::placeholder,
|
|
219
|
-
.sw-form-field .p-inputtext::placeholder {
|
|
217
|
+
.sw-srh-form-field input::placeholder,
|
|
218
|
+
.sw-srh-form-field .p-inputtext::placeholder {
|
|
220
219
|
color: var(--sw-label-color) !important;
|
|
221
220
|
}
|
|
222
221
|
.sw-form-swap {
|
|
@@ -234,7 +233,7 @@ var flightSearchWidgetStyles = `
|
|
|
234
233
|
cursor: pointer;
|
|
235
234
|
transform: translate(50%, -50%);
|
|
236
235
|
}
|
|
237
|
-
.sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-form-field.sw-pos-rel:last-child {
|
|
236
|
+
.sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-srh-form-field.sw-pos-rel:last-child {
|
|
238
237
|
padding-inline-start: 25px;
|
|
239
238
|
}
|
|
240
239
|
.sw-custom-dropdown {
|
|
@@ -850,7 +849,7 @@ padding-inline-start: 25px;
|
|
|
850
849
|
min-width: 0;
|
|
851
850
|
overflow: visible;
|
|
852
851
|
}
|
|
853
|
-
.sw-srh-wrap .sw-form-field {
|
|
852
|
+
.sw-srh-wrap .sw-srh-form-field {
|
|
854
853
|
flex: 1 1 50%;
|
|
855
854
|
min-width: 0;
|
|
856
855
|
justify-content: center;
|
|
@@ -1146,7 +1145,7 @@ padding-inline-start: 25px;
|
|
|
1146
1145
|
.sw-container .MobileHide{
|
|
1147
1146
|
display: block;
|
|
1148
1147
|
}
|
|
1149
|
-
@media screen and (max-width:
|
|
1148
|
+
@media screen and (max-width: 1024px) {
|
|
1150
1149
|
.sw-container .MobileShow{
|
|
1151
1150
|
display: block;
|
|
1152
1151
|
}
|
|
@@ -1173,8 +1172,7 @@ padding-inline-start: 25px;
|
|
|
1173
1172
|
display: none;
|
|
1174
1173
|
}
|
|
1175
1174
|
}
|
|
1176
|
-
|
|
1177
|
-
.sw-container .sw-form-field {
|
|
1175
|
+
.sw-container .sw-srh-form-field {
|
|
1178
1176
|
border-radius: var(--sw-radius);
|
|
1179
1177
|
}
|
|
1180
1178
|
.sw-fsrh-adv-cont{
|
|
@@ -1205,7 +1203,7 @@ padding-inline-start: 25px;
|
|
|
1205
1203
|
line-height: 1;
|
|
1206
1204
|
}
|
|
1207
1205
|
}
|
|
1208
|
-
.sw-container .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-form-field.sw-pos-rel:last-child{
|
|
1206
|
+
.sw-container .sw-srh-wrap.sw-srh-box.sw-pos-rel .sw-srh-form-field.sw-pos-rel:last-child{
|
|
1209
1207
|
padding-inline-start: 15px;
|
|
1210
1208
|
}
|
|
1211
1209
|
.sw-container .p-datepicker-group + .p-datepicker-group .mobileHead {
|
|
@@ -1996,7 +1994,7 @@ function FlightSearchWidget({
|
|
|
1996
1994
|
case "multi-city":
|
|
1997
1995
|
return 3;
|
|
1998
1996
|
case "custom-search":
|
|
1999
|
-
return
|
|
1997
|
+
return 1;
|
|
2000
1998
|
default:
|
|
2001
1999
|
return 2;
|
|
2002
2000
|
}
|
|
@@ -2161,7 +2159,7 @@ function FlightSearchWidget({
|
|
|
2161
2159
|
const list = isOrigin ? getPredictiveState(segmentIndex).fromAirport : getPredictiveState(segmentIndex).toAirport;
|
|
2162
2160
|
const selectedIndex = isOrigin ? getPredictiveState(segmentIndex).selectedFromIndex : getPredictiveState(segmentIndex).selectedToIndex;
|
|
2163
2161
|
const isFirstOrigin = segmentIndex === 0 && isOrigin;
|
|
2164
|
-
return /* @__PURE__ */ jsxs("div", { className: `sw-form-field sw-pos-rel${isOrigin ? " br-left" : ""} ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-is-invalid" : ""}`, children: [
|
|
2162
|
+
return /* @__PURE__ */ jsxs("div", { className: `sw-srh-form-field sw-pos-rel${isOrigin ? " br-left" : ""} ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-is-invalid" : ""}`, children: [
|
|
2165
2163
|
/* @__PURE__ */ jsx("label", { htmlFor: `${dropdownType}-${segmentIndex}`, children: label }),
|
|
2166
2164
|
/* @__PURE__ */ jsxs("div", { className: `sw-custom-dropdown ${validationErrors[segmentIndex]?.[dropdownType] ? "sw-has-error" : ""}`, ref: dropdownRef, children: [
|
|
2167
2165
|
/* @__PURE__ */ jsx(
|
|
@@ -2270,7 +2268,7 @@ function FlightSearchWidget({
|
|
|
2270
2268
|
renderAirportDropdown(index, "destination", destinationDropdownRef || destinationRef, isDestOpen, () => toggleSegmentDropdown(index, "destination"))
|
|
2271
2269
|
] }, index),
|
|
2272
2270
|
isMultiCityOrCustom && /* @__PURE__ */ jsxs("div", { className: "sw-srh-wrap sw-pos-rel", children: [
|
|
2273
|
-
/* @__PURE__ */ jsxs("div", { className: "sw-form-field sw-com-cal
|
|
2271
|
+
/* @__PURE__ */ jsxs("div", { className: "sw-srh-form-field sw-com-cal", children: [
|
|
2274
2272
|
/* @__PURE__ */ jsx("label", { htmlFor: `departure-${index}`, children: "Departure" }),
|
|
2275
2273
|
/* @__PURE__ */ jsx(
|
|
2276
2274
|
Calendar,
|
|
@@ -2393,7 +2391,7 @@ function FlightSearchWidget({
|
|
|
2393
2391
|
/* @__PURE__ */ jsxs("div", { style: { cursor: "pointer" }, onClick: () => {
|
|
2394
2392
|
dateRangeCalendarRef.current?.show?.();
|
|
2395
2393
|
mobileDateRangeCalendarRef.current?.show?.();
|
|
2396
|
-
}, className: "sw-form-field sw-com-cal", children: [
|
|
2394
|
+
}, className: "sw-srh-form-field sw-com-cal", children: [
|
|
2397
2395
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
2398
2396
|
/* @__PURE__ */ jsx("label", { children: "Departure" }),
|
|
2399
2397
|
/* @__PURE__ */ jsx("p", { children: segments[0]?.dateRange?.[0]?.toLocaleDateString("en-GB", { day: "2-digit", month: "short", year: "numeric" }) })
|
|
@@ -2482,7 +2480,7 @@ function FlightSearchWidget({
|
|
|
2482
2480
|
}
|
|
2483
2481
|
)
|
|
2484
2482
|
] }),
|
|
2485
|
-
/* @__PURE__ */ jsx("div", { style: { cursor: "pointer" }, className: "sw-form-field sw-com-cal", onClick: () => {
|
|
2483
|
+
/* @__PURE__ */ jsx("div", { style: { cursor: "pointer" }, className: "sw-srh-form-field sw-com-cal", onClick: () => {
|
|
2486
2484
|
dateRangeCalendarRef.current?.show?.();
|
|
2487
2485
|
mobileDateRangeCalendarRef.current?.show?.();
|
|
2488
2486
|
}, children: /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -2493,7 +2491,7 @@ function FlightSearchWidget({
|
|
|
2493
2491
|
/* @__PURE__ */ jsxs(
|
|
2494
2492
|
"div",
|
|
2495
2493
|
{
|
|
2496
|
-
className: "sw-form-field sw-pos-rel sw-com-cal",
|
|
2494
|
+
className: "sw-srh-form-field sw-pos-rel sw-com-cal",
|
|
2497
2495
|
style: { cursor: "pointer" },
|
|
2498
2496
|
onClick: () => {
|
|
2499
2497
|
oneWayDesktopCalendarRef.current?.show?.();
|
|
@@ -2571,7 +2569,7 @@ function FlightSearchWidget({
|
|
|
2571
2569
|
]
|
|
2572
2570
|
}
|
|
2573
2571
|
),
|
|
2574
|
-
/* @__PURE__ */ jsx("div", { className: "sw-form-field sw-pos-rel sw-com-cal sw-add-return-label", style: { cursor: "pointer" }, onClick: () => {
|
|
2572
|
+
/* @__PURE__ */ jsx("div", { className: "sw-srh-form-field sw-pos-rel sw-com-cal sw-add-return-label", style: { cursor: "pointer" }, onClick: () => {
|
|
2575
2573
|
setTripType("round-trip");
|
|
2576
2574
|
setTimeout(() => document.getElementById("dateRange")?.querySelector("input")?.focus?.(), 100);
|
|
2577
2575
|
}, children: /* @__PURE__ */ jsx("label", { className: "font14", children: "Add return" }) })
|
|
@@ -2583,7 +2581,7 @@ function FlightSearchWidget({
|
|
|
2583
2581
|
] }),
|
|
2584
2582
|
"Add Another Flight"
|
|
2585
2583
|
] }) }),
|
|
2586
|
-
/* @__PURE__ */ jsxs("div", { className: "sw-form-field sw-traveller sw-pos-rel", children: [
|
|
2584
|
+
/* @__PURE__ */ jsxs("div", { className: "sw-srh-form-field sw-traveller sw-pos-rel", children: [
|
|
2587
2585
|
/* @__PURE__ */ jsx("label", { htmlFor: "rooms", children: "Travellers and Class" }),
|
|
2588
2586
|
/* @__PURE__ */ jsxs("div", { className: "sw-custom-dropdown", ref: roomsGuestsMenuRef, children: [
|
|
2589
2587
|
/* @__PURE__ */ jsx(
|