related-ui-components 1.3.4 → 1.3.6
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/lib/commonjs/app.js +39 -20
- package/lib/commonjs/app.js.map +1 -1
- package/lib/commonjs/components/Banner/Banner.js +1 -1
- package/lib/commonjs/components/Banner/Banner.js.map +1 -1
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js +358 -0
- package/lib/commonjs/components/DateRangePicker/DateRangePicker.js.map +1 -0
- package/lib/commonjs/components/DateRangePicker/index.js +4 -0
- package/lib/commonjs/components/DateRangePicker/index.js.map +1 -0
- package/lib/commonjs/components/Filters/Filters.js +1 -1
- package/lib/commonjs/components/Filters/Filters.js.map +1 -1
- package/lib/commonjs/components/Input/Input.js +2 -2
- package/lib/commonjs/components/Input/Input.js.map +1 -1
- package/lib/commonjs/components/NumericStepper/NumericStepper.js +103 -0
- package/lib/commonjs/components/NumericStepper/NumericStepper.js.map +1 -0
- package/lib/commonjs/components/NumericStepper/index.js +29 -0
- package/lib/commonjs/components/NumericStepper/index.js.map +1 -0
- package/lib/commonjs/components/SelectAmount/SelectAmount.js +189 -0
- package/lib/commonjs/components/SelectAmount/SelectAmount.js.map +1 -0
- package/lib/commonjs/components/SelectAmount/index.js +4 -0
- package/lib/commonjs/components/SelectAmount/index.js.map +1 -0
- package/lib/commonjs/components/Suggestions/SuggestionList.js +98 -0
- package/lib/commonjs/components/Suggestions/SuggestionList.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/CarRentalForm.js +370 -0
- package/lib/commonjs/components/TravelBooking/CarRentalForm.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/FlightForm.js +347 -0
- package/lib/commonjs/components/TravelBooking/FlightForm.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/FlightSummary.js +257 -0
- package/lib/commonjs/components/TravelBooking/FlightSummary.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/HotelForm.js +290 -0
- package/lib/commonjs/components/TravelBooking/HotelForm.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/HotelSummary.js +246 -0
- package/lib/commonjs/components/TravelBooking/HotelSummary.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/README.md +421 -0
- package/lib/commonjs/components/TravelBooking/SummaryBar.js +181 -0
- package/lib/commonjs/components/TravelBooking/SummaryBar.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/TabSelector.js +115 -0
- package/lib/commonjs/components/TravelBooking/TabSelector.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/TravelBooking.js +261 -0
- package/lib/commonjs/components/TravelBooking/TravelBooking.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/index.js +22 -0
- package/lib/commonjs/components/TravelBooking/index.js.map +1 -0
- package/lib/commonjs/components/TravelBooking/types.js +15 -0
- package/lib/commonjs/components/TravelBooking/types.js.map +1 -0
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.js +2 -2
- package/lib/commonjs/components/UnlockRewards/UnlockRewards.js.map +1 -1
- package/lib/commonjs/index.js +0 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/app.js +43 -24
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Banner/Banner.js +1 -1
- package/lib/module/components/Banner/Banner.js.map +1 -1
- package/lib/module/components/DateRangePicker/DateRangePicker.js +350 -0
- package/lib/module/components/DateRangePicker/DateRangePicker.js.map +1 -0
- package/lib/module/components/DateRangePicker/index.js +4 -0
- package/lib/module/components/DateRangePicker/index.js.map +1 -0
- package/lib/module/components/Filters/Filters.js +1 -1
- package/lib/module/components/Filters/Filters.js.map +1 -1
- package/lib/module/components/Input/Input.js +2 -2
- package/lib/module/components/Input/Input.js.map +1 -1
- package/lib/module/components/NumericStepper/NumericStepper.js +96 -0
- package/lib/module/components/NumericStepper/NumericStepper.js.map +1 -0
- package/lib/module/components/NumericStepper/index.js +5 -0
- package/lib/module/components/NumericStepper/index.js.map +1 -0
- package/lib/module/components/SelectAmount/SelectAmount.js +184 -0
- package/lib/module/components/SelectAmount/SelectAmount.js.map +1 -0
- package/lib/module/components/SelectAmount/index.js +4 -0
- package/lib/module/components/SelectAmount/index.js.map +1 -0
- package/lib/module/components/Suggestions/SuggestionList.js +92 -0
- package/lib/module/components/Suggestions/SuggestionList.js.map +1 -0
- package/lib/module/components/TravelBooking/CarRentalForm.js +363 -0
- package/lib/module/components/TravelBooking/CarRentalForm.js.map +1 -0
- package/lib/module/components/TravelBooking/FlightForm.js +340 -0
- package/lib/module/components/TravelBooking/FlightForm.js.map +1 -0
- package/lib/module/components/TravelBooking/FlightSummary.js +254 -0
- package/lib/module/components/TravelBooking/FlightSummary.js.map +1 -0
- package/lib/module/components/TravelBooking/HotelForm.js +286 -0
- package/lib/module/components/TravelBooking/HotelForm.js.map +1 -0
- package/lib/module/components/TravelBooking/HotelSummary.js +239 -0
- package/lib/module/components/TravelBooking/HotelSummary.js.map +1 -0
- package/lib/module/components/TravelBooking/README.md +421 -0
- package/lib/module/components/TravelBooking/SummaryBar.js +174 -0
- package/lib/module/components/TravelBooking/SummaryBar.js.map +1 -0
- package/lib/module/components/TravelBooking/TabSelector.js +110 -0
- package/lib/module/components/TravelBooking/TabSelector.js.map +1 -0
- package/lib/module/components/TravelBooking/TravelBooking.js +243 -0
- package/lib/module/components/TravelBooking/TravelBooking.js.map +1 -0
- package/lib/module/components/TravelBooking/index.js +22 -0
- package/lib/module/components/TravelBooking/index.js.map +1 -0
- package/lib/module/components/TravelBooking/types.js +11 -0
- package/lib/module/components/TravelBooking/types.js.map +1 -0
- package/lib/module/components/UnlockRewards/UnlockRewards.js +2 -2
- package/lib/module/components/UnlockRewards/UnlockRewards.js.map +1 -1
- package/lib/module/index.js +7 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/commonjs/app.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts +2 -2
- package/lib/typescript/commonjs/components/Banner/Banner.d.ts.map +1 -1
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts +25 -0
- package/lib/typescript/commonjs/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/DateRangePicker/index.d.ts +1 -0
- package/lib/typescript/commonjs/components/DateRangePicker/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/NumericStepper/NumericStepper.d.ts +19 -0
- package/lib/typescript/commonjs/components/NumericStepper/NumericStepper.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/NumericStepper/index.d.ts +3 -0
- package/lib/typescript/commonjs/components/NumericStepper/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/SelectAmount/SelectAmount.d.ts +29 -0
- package/lib/typescript/commonjs/components/SelectAmount/SelectAmount.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/SelectAmount/index.d.ts +1 -0
- package/lib/typescript/commonjs/components/SelectAmount/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/Suggestions/SuggestionList.d.ts +14 -0
- package/lib/typescript/commonjs/components/Suggestions/SuggestionList.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/CarRentalForm.d.ts +58 -0
- package/lib/typescript/commonjs/components/TravelBooking/CarRentalForm.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/FlightForm.d.ts +57 -0
- package/lib/typescript/commonjs/components/TravelBooking/FlightForm.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/FlightSummary.d.ts +41 -0
- package/lib/typescript/commonjs/components/TravelBooking/FlightSummary.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/HotelForm.d.ts +52 -0
- package/lib/typescript/commonjs/components/TravelBooking/HotelForm.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/HotelSummary.d.ts +44 -0
- package/lib/typescript/commonjs/components/TravelBooking/HotelSummary.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/SummaryBar.d.ts +17 -0
- package/lib/typescript/commonjs/components/TravelBooking/SummaryBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/TabSelector.d.ts +17 -0
- package/lib/typescript/commonjs/components/TravelBooking/TabSelector.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/TravelBooking.d.ts +84 -0
- package/lib/typescript/commonjs/components/TravelBooking/TravelBooking.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/index.d.ts +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/components/TravelBooking/types.d.ts +26 -0
- package/lib/typescript/commonjs/components/TravelBooking/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +0 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/module/app.d.ts.map +1 -1
- package/lib/typescript/module/components/Banner/Banner.d.ts +2 -2
- package/lib/typescript/module/components/Banner/Banner.d.ts.map +1 -1
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts +25 -0
- package/lib/typescript/module/components/DateRangePicker/DateRangePicker.d.ts.map +1 -0
- package/lib/typescript/module/components/DateRangePicker/index.d.ts +1 -0
- package/lib/typescript/module/components/DateRangePicker/index.d.ts.map +1 -0
- package/lib/typescript/module/components/NumericStepper/NumericStepper.d.ts +19 -0
- package/lib/typescript/module/components/NumericStepper/NumericStepper.d.ts.map +1 -0
- package/lib/typescript/module/components/NumericStepper/index.d.ts +3 -0
- package/lib/typescript/module/components/NumericStepper/index.d.ts.map +1 -0
- package/lib/typescript/module/components/SelectAmount/SelectAmount.d.ts +29 -0
- package/lib/typescript/module/components/SelectAmount/SelectAmount.d.ts.map +1 -0
- package/lib/typescript/module/components/SelectAmount/index.d.ts +1 -0
- package/lib/typescript/module/components/SelectAmount/index.d.ts.map +1 -0
- package/lib/typescript/module/components/Suggestions/SuggestionList.d.ts +14 -0
- package/lib/typescript/module/components/Suggestions/SuggestionList.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/CarRentalForm.d.ts +58 -0
- package/lib/typescript/module/components/TravelBooking/CarRentalForm.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/FlightForm.d.ts +57 -0
- package/lib/typescript/module/components/TravelBooking/FlightForm.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/FlightSummary.d.ts +41 -0
- package/lib/typescript/module/components/TravelBooking/FlightSummary.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/HotelForm.d.ts +52 -0
- package/lib/typescript/module/components/TravelBooking/HotelForm.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/HotelSummary.d.ts +44 -0
- package/lib/typescript/module/components/TravelBooking/HotelSummary.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/SummaryBar.d.ts +17 -0
- package/lib/typescript/module/components/TravelBooking/SummaryBar.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/TabSelector.d.ts +17 -0
- package/lib/typescript/module/components/TravelBooking/TabSelector.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/TravelBooking.d.ts +84 -0
- package/lib/typescript/module/components/TravelBooking/TravelBooking.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/index.d.ts +1 -0
- package/lib/typescript/module/components/TravelBooking/index.d.ts.map +1 -0
- package/lib/typescript/module/components/TravelBooking/types.d.ts +26 -0
- package/lib/typescript/module/components/TravelBooking/types.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +0 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/package.json +12 -8
- package/src/app.tsx +80 -13
- package/src/components/Banner/Banner.tsx +3 -2
- package/src/components/DateRangePicker/DateRangePicker.tsx +410 -0
- package/src/components/DateRangePicker/index.ts +2 -0
- package/src/components/Filters/Filters.tsx +1 -1
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/NumericStepper/NumericStepper.tsx +117 -0
- package/src/components/NumericStepper/index.ts +2 -0
- package/src/components/SelectAmount/SelectAmount.tsx +217 -0
- package/src/components/SelectAmount/index.ts +2 -0
- package/src/components/Suggestions/SuggestionList.tsx +106 -0
- package/src/components/TravelBooking/CarRentalForm.tsx +440 -0
- package/src/components/TravelBooking/FlightForm.tsx +452 -0
- package/src/components/TravelBooking/FlightSummary.tsx +388 -0
- package/src/components/TravelBooking/HotelForm.tsx +365 -0
- package/src/components/TravelBooking/HotelSummary.tsx +340 -0
- package/src/components/TravelBooking/README.md +421 -0
- package/src/components/TravelBooking/SummaryBar.tsx +239 -0
- package/src/components/TravelBooking/TabSelector.tsx +158 -0
- package/src/components/TravelBooking/TravelBooking.tsx +407 -0
- package/src/components/TravelBooking/index.ts +20 -0
- package/src/components/TravelBooking/types.ts +28 -0
- package/src/components/UnlockRewards/UnlockRewards.tsx +2 -2
- package/src/index.ts +4 -4
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useTheme } from "@/theme";
|
|
4
|
+
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
|
|
6
|
+
import { Ionicons } from "@expo/vector-icons";
|
|
7
|
+
import CustomInput from "../Input/Input.js";
|
|
8
|
+
import DateRangePicker from "../DateRangePicker/DateRangePicker.js";
|
|
9
|
+
import SuggestionList from "../Suggestions/SuggestionList.js";
|
|
10
|
+
import { FormInputType } from "./types.js";
|
|
11
|
+
|
|
12
|
+
// --- Helper Types ---
|
|
13
|
+
|
|
14
|
+
// --- Component Props ---
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
// --- Component ---
|
|
17
|
+
const FlightForm = ({
|
|
18
|
+
initialFromLocation = "Beirut, Beirut Intl Arpt - BEY",
|
|
19
|
+
initialToLocation = "Dubai, Dubai Intl Arpt - DXB",
|
|
20
|
+
initialDepartureDate,
|
|
21
|
+
initialReturnDate,
|
|
22
|
+
onSwapPress,
|
|
23
|
+
onSearchPress,
|
|
24
|
+
onInputFocus,
|
|
25
|
+
onTextChange,
|
|
26
|
+
fromLabel = "FROM",
|
|
27
|
+
toLabel = "TO",
|
|
28
|
+
fromPlaceholder = "From Where?",
|
|
29
|
+
toPlaceholder = "To Where?",
|
|
30
|
+
departureLabel = "DEPARTURE",
|
|
31
|
+
returnLabel = "RETURN",
|
|
32
|
+
swapIconName = "swap-horizontal",
|
|
33
|
+
searchIconName = "search",
|
|
34
|
+
calendarThemeOverrides = {},
|
|
35
|
+
isOneWay,
|
|
36
|
+
suggestionData,
|
|
37
|
+
// Style Props
|
|
38
|
+
containerStyle,
|
|
39
|
+
inputGroupContainerStyle,
|
|
40
|
+
inputWrapperStyle,
|
|
41
|
+
customInputContainerStyle,
|
|
42
|
+
// Renamed from inputStyle for clarity
|
|
43
|
+
labelStyle,
|
|
44
|
+
swapButtonContainerStyle,
|
|
45
|
+
swapButtonStyle,
|
|
46
|
+
swapIconStyle,
|
|
47
|
+
departureRowStyle,
|
|
48
|
+
searchButtonStyle,
|
|
49
|
+
searchIconStyle,
|
|
50
|
+
dateRangePickerOuterContainerStyle,
|
|
51
|
+
dateRangePickerLabelStyle,
|
|
52
|
+
dateRangePickerInputGroupStyle,
|
|
53
|
+
dateRangePickerCalendarContainerStyle,
|
|
54
|
+
suggestionListContainerStyle,
|
|
55
|
+
suggestionItemGroupStyle,
|
|
56
|
+
suggestionCityRowStyle,
|
|
57
|
+
suggestionCityIconStyle,
|
|
58
|
+
suggestionCityTextStyle,
|
|
59
|
+
suggestionAirportTouchableStyle,
|
|
60
|
+
suggestionAirportIconStyle,
|
|
61
|
+
suggestionAirportTextStyle
|
|
62
|
+
}) => {
|
|
63
|
+
const {
|
|
64
|
+
theme,
|
|
65
|
+
isRTL
|
|
66
|
+
} = useTheme();
|
|
67
|
+
const styles = useMemo(() => themedStyles(theme, isRTL), [theme, isRTL]);
|
|
68
|
+
const toLocationInput = useRef(null);
|
|
69
|
+
const fromLocationInput = useRef(null);
|
|
70
|
+
|
|
71
|
+
// --- State ---
|
|
72
|
+
const [fromLocation, setFromLocation] = useState(initialFromLocation);
|
|
73
|
+
const [toLocation, setToLocation] = useState(initialToLocation);
|
|
74
|
+
const [departureDate, setDepartureDate] = useState(initialDepartureDate);
|
|
75
|
+
const [returnDate, setReturnDate] = useState(initialReturnDate);
|
|
76
|
+
const [focusedInput, setFocusedInput] = useState();
|
|
77
|
+
|
|
78
|
+
// --- Handlers ---
|
|
79
|
+
const handleSwap = useCallback(() => {
|
|
80
|
+
const currentFrom = fromLocation;
|
|
81
|
+
const currentTo = toLocation;
|
|
82
|
+
setFromLocation(currentTo);
|
|
83
|
+
setToLocation(currentFrom);
|
|
84
|
+
onSwapPress?.(currentFrom, currentTo);
|
|
85
|
+
}, [fromLocation, toLocation, onSwapPress]);
|
|
86
|
+
const handleSearch = useCallback(() => {
|
|
87
|
+
onSearchPress?.({
|
|
88
|
+
from: fromLocation,
|
|
89
|
+
to: toLocation,
|
|
90
|
+
departure: departureDate,
|
|
91
|
+
return: isOneWay ? undefined : returnDate // Only send return if not one way
|
|
92
|
+
});
|
|
93
|
+
}, [fromLocation, toLocation, departureDate, returnDate, isOneWay, onSearchPress]);
|
|
94
|
+
|
|
95
|
+
// --- Default Suggestion Renderer (Now Stylable) ---
|
|
96
|
+
const suggestionRenderItem = item => /*#__PURE__*/_jsxs(View, {
|
|
97
|
+
style: [styles.suggestionItemGroup, suggestionItemGroupStyle],
|
|
98
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
99
|
+
style: [styles.suggestionCityRow, suggestionCityRowStyle],
|
|
100
|
+
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
101
|
+
name: "airplane" // Consider making icon name a prop too if needed
|
|
102
|
+
,
|
|
103
|
+
size: 20,
|
|
104
|
+
color: theme.primary,
|
|
105
|
+
style: [styles.suggestionCityIcon, suggestionCityIconStyle]
|
|
106
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
107
|
+
style: [styles.suggestionCityText, suggestionCityTextStyle],
|
|
108
|
+
children: item.city
|
|
109
|
+
})]
|
|
110
|
+
}), item.airports.map((airport, index) => /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
111
|
+
style: [styles.suggestionAirportTouchable, suggestionAirportTouchableStyle],
|
|
112
|
+
onPress: () => {
|
|
113
|
+
if (focusedInput == FormInputType.FLIGHT_TO) {
|
|
114
|
+
setToLocation(airport);
|
|
115
|
+
toLocationInput.current?.blur();
|
|
116
|
+
} else {
|
|
117
|
+
setFromLocation(airport);
|
|
118
|
+
fromLocationInput.current?.blur();
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
122
|
+
name: "arrow-forward",
|
|
123
|
+
size: 18,
|
|
124
|
+
color: theme.primary,
|
|
125
|
+
style: [styles.suggestionAirportIcon, suggestionAirportIconStyle]
|
|
126
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
127
|
+
style: [styles.suggestionAirportText, suggestionAirportTextStyle],
|
|
128
|
+
children: airport
|
|
129
|
+
})]
|
|
130
|
+
}, `${item.id}-${index}`))]
|
|
131
|
+
}, item.id);
|
|
132
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
133
|
+
style: [styles.container, containerStyle],
|
|
134
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
135
|
+
style: [styles.inputGroupContainer, inputGroupContainerStyle],
|
|
136
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
137
|
+
style: [styles.inputWrapper, inputWrapperStyle],
|
|
138
|
+
children: [/*#__PURE__*/_jsx(CustomInput, {
|
|
139
|
+
ref: fromLocationInput,
|
|
140
|
+
onChangeText: text => {
|
|
141
|
+
setFromLocation(text);
|
|
142
|
+
onTextChange?.(text);
|
|
143
|
+
},
|
|
144
|
+
label: fromLabel,
|
|
145
|
+
value: fromLocation,
|
|
146
|
+
labelStyle: [styles.label, labelStyle],
|
|
147
|
+
placeholder: fromPlaceholder,
|
|
148
|
+
onFocus: () => {
|
|
149
|
+
setFocusedInput(FormInputType.FLIGHT_FROM);
|
|
150
|
+
onInputFocus?.(FormInputType.FLIGHT_FROM);
|
|
151
|
+
},
|
|
152
|
+
onBlur: () => {
|
|
153
|
+
setTimeout(() => {
|
|
154
|
+
if (focusedInput === FormInputType.FLIGHT_FROM) {
|
|
155
|
+
setFocusedInput(undefined);
|
|
156
|
+
}
|
|
157
|
+
}, 150);
|
|
158
|
+
},
|
|
159
|
+
containerStyle: customInputContainerStyle
|
|
160
|
+
}), suggestionData && /*#__PURE__*/_jsx(SuggestionList, {
|
|
161
|
+
data: suggestionData,
|
|
162
|
+
visible: focusedInput === FormInputType.FLIGHT_FROM,
|
|
163
|
+
renderItemContent: suggestionRenderItem,
|
|
164
|
+
containerStyle: suggestionListContainerStyle
|
|
165
|
+
})]
|
|
166
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
167
|
+
style: [styles.swapButtonContainer, swapButtonContainerStyle],
|
|
168
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
169
|
+
style: [styles.swapButton, swapButtonStyle],
|
|
170
|
+
onPress: handleSwap,
|
|
171
|
+
activeOpacity: 0.7,
|
|
172
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
173
|
+
name: swapIconName,
|
|
174
|
+
size: 20,
|
|
175
|
+
color: theme.onSurface,
|
|
176
|
+
style: swapIconStyle
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
180
|
+
style: [styles.inputWrapper, inputWrapperStyle],
|
|
181
|
+
children: [/*#__PURE__*/_jsx(CustomInput, {
|
|
182
|
+
ref: toLocationInput,
|
|
183
|
+
onChangeText: text => {
|
|
184
|
+
setToLocation(text);
|
|
185
|
+
onTextChange?.(text);
|
|
186
|
+
},
|
|
187
|
+
label: toLabel,
|
|
188
|
+
value: toLocation,
|
|
189
|
+
labelStyle: [styles.label, labelStyle],
|
|
190
|
+
placeholder: toPlaceholder,
|
|
191
|
+
onFocus: () => {
|
|
192
|
+
setFocusedInput(FormInputType.FLIGHT_TO);
|
|
193
|
+
onInputFocus?.(FormInputType.FLIGHT_TO);
|
|
194
|
+
},
|
|
195
|
+
onBlur: () => {
|
|
196
|
+
// Delay blur slightly to allow suggestion press
|
|
197
|
+
setTimeout(() => {
|
|
198
|
+
if (focusedInput === FormInputType.FLIGHT_TO) {
|
|
199
|
+
setFocusedInput(undefined);
|
|
200
|
+
}
|
|
201
|
+
}, 150);
|
|
202
|
+
}
|
|
203
|
+
// Apply customInputContainerStyle (passed to CustomInput)
|
|
204
|
+
,
|
|
205
|
+
containerStyle: customInputContainerStyle
|
|
206
|
+
}), suggestionData && /*#__PURE__*/_jsx(SuggestionList, {
|
|
207
|
+
data: suggestionData,
|
|
208
|
+
visible: focusedInput === FormInputType.FLIGHT_TO,
|
|
209
|
+
renderItemContent: suggestionRenderItem
|
|
210
|
+
// Apply suggestionListContainerStyle
|
|
211
|
+
,
|
|
212
|
+
containerStyle: suggestionListContainerStyle
|
|
213
|
+
})]
|
|
214
|
+
})]
|
|
215
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
216
|
+
style: [styles.departureRow, departureRowStyle],
|
|
217
|
+
children: [/*#__PURE__*/_jsx(DateRangePicker, {
|
|
218
|
+
returnLabel: returnLabel,
|
|
219
|
+
departureLabel: departureLabel,
|
|
220
|
+
outerContainerStyle: [styles.dateRangePickerOuterContainer, dateRangePickerOuterContainerStyle],
|
|
221
|
+
labelStyle: [labelStyle, dateRangePickerLabelStyle],
|
|
222
|
+
inputGroupStyle: dateRangePickerInputGroupStyle,
|
|
223
|
+
calendarContainerStyle: dateRangePickerCalendarContainerStyle,
|
|
224
|
+
calendarThemeOverrides: calendarThemeOverrides,
|
|
225
|
+
onDatesChange: d => {
|
|
226
|
+
setDepartureDate(d.departure);
|
|
227
|
+
setReturnDate(d.return);
|
|
228
|
+
},
|
|
229
|
+
isOneWay: isOneWay,
|
|
230
|
+
initialDepartureDate: initialDepartureDate,
|
|
231
|
+
initialReturnDate: initialReturnDate
|
|
232
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
233
|
+
style: [styles.searchButton, searchButtonStyle],
|
|
234
|
+
onPress: handleSearch,
|
|
235
|
+
activeOpacity: 0.8,
|
|
236
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
237
|
+
name: searchIconName,
|
|
238
|
+
size: 24,
|
|
239
|
+
color: theme.onPrimary,
|
|
240
|
+
style: searchIconStyle
|
|
241
|
+
})
|
|
242
|
+
})]
|
|
243
|
+
})]
|
|
244
|
+
});
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
// --- Styles ---
|
|
248
|
+
const themedStyles = (theme, isRTL) => StyleSheet.create({
|
|
249
|
+
container: {
|
|
250
|
+
padding: 16,
|
|
251
|
+
backgroundColor: theme.surface,
|
|
252
|
+
borderBottomRightRadius: 8,
|
|
253
|
+
borderBottomLeftRadius: 8
|
|
254
|
+
},
|
|
255
|
+
inputGroupContainer: {
|
|
256
|
+
position: "relative"
|
|
257
|
+
},
|
|
258
|
+
inputWrapper: {
|
|
259
|
+
marginBottom: 15,
|
|
260
|
+
position: "relative"
|
|
261
|
+
},
|
|
262
|
+
label: {
|
|
263
|
+
color: theme.labelText,
|
|
264
|
+
fontSize: 12,
|
|
265
|
+
fontWeight: "600",
|
|
266
|
+
textTransform: "uppercase",
|
|
267
|
+
textAlign: isRTL ? "right" : "left",
|
|
268
|
+
marginBottom: 6
|
|
269
|
+
},
|
|
270
|
+
swapButtonContainer: {
|
|
271
|
+
// Position swap button between the two input wrappers
|
|
272
|
+
// position: "absolute",
|
|
273
|
+
// left: 0,
|
|
274
|
+
// right: 0,
|
|
275
|
+
// top: "50%", // Adjust as needed based on CustomInput height
|
|
276
|
+
// transform: [{ translateY: -18 }], // Half the button height
|
|
277
|
+
alignItems: "center"
|
|
278
|
+
// zIndex: 1, // Ensure button is clickable above inputs
|
|
279
|
+
},
|
|
280
|
+
swapButton: {
|
|
281
|
+
width: 36,
|
|
282
|
+
height: 36,
|
|
283
|
+
borderRadius: 18,
|
|
284
|
+
backgroundColor: theme.surface,
|
|
285
|
+
borderColor: theme.border,
|
|
286
|
+
borderWidth: 1,
|
|
287
|
+
justifyContent: "center",
|
|
288
|
+
alignItems: "center"
|
|
289
|
+
},
|
|
290
|
+
departureRow: {
|
|
291
|
+
flexDirection: isRTL ? "row-reverse" : "row",
|
|
292
|
+
alignItems: "flex-end",
|
|
293
|
+
marginTop: 10,
|
|
294
|
+
gap: 10
|
|
295
|
+
},
|
|
296
|
+
dateRangePickerOuterContainer: {
|
|
297
|
+
flex: 1
|
|
298
|
+
},
|
|
299
|
+
searchButton: {
|
|
300
|
+
backgroundColor: theme.primary,
|
|
301
|
+
width: 50,
|
|
302
|
+
height: 50,
|
|
303
|
+
borderRadius: 8,
|
|
304
|
+
justifyContent: "center",
|
|
305
|
+
alignItems: "center"
|
|
306
|
+
},
|
|
307
|
+
suggestionItemGroup: {
|
|
308
|
+
paddingVertical: 8,
|
|
309
|
+
paddingHorizontal: 12,
|
|
310
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
311
|
+
borderBottomColor: theme.border,
|
|
312
|
+
backgroundColor: theme.surface
|
|
313
|
+
},
|
|
314
|
+
suggestionCityRow: {
|
|
315
|
+
flexDirection: "row",
|
|
316
|
+
alignItems: "center",
|
|
317
|
+
gap: 10,
|
|
318
|
+
marginBottom: 5
|
|
319
|
+
},
|
|
320
|
+
suggestionCityIcon: {},
|
|
321
|
+
suggestionCityText: {
|
|
322
|
+
fontSize: 15,
|
|
323
|
+
fontWeight: "600",
|
|
324
|
+
color: theme.onSurface
|
|
325
|
+
},
|
|
326
|
+
suggestionAirportTouchable: {
|
|
327
|
+
flexDirection: "row",
|
|
328
|
+
alignItems: "center",
|
|
329
|
+
gap: 10,
|
|
330
|
+
paddingVertical: 4,
|
|
331
|
+
marginLeft: 25
|
|
332
|
+
},
|
|
333
|
+
suggestionAirportIcon: {},
|
|
334
|
+
suggestionAirportText: {
|
|
335
|
+
fontSize: 14,
|
|
336
|
+
color: theme.onSurfaceVariant
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
export default FlightForm;
|
|
340
|
+
//# sourceMappingURL=FlightForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useTheme","React","useCallback","useMemo","useRef","useState","View","Text","TouchableOpacity","StyleSheet","Ionicons","CustomInput","DateRangePicker","SuggestionList","FormInputType","jsx","_jsx","jsxs","_jsxs","FlightForm","initialFromLocation","initialToLocation","initialDepartureDate","initialReturnDate","onSwapPress","onSearchPress","onInputFocus","onTextChange","fromLabel","toLabel","fromPlaceholder","toPlaceholder","departureLabel","returnLabel","swapIconName","searchIconName","calendarThemeOverrides","isOneWay","suggestionData","containerStyle","inputGroupContainerStyle","inputWrapperStyle","customInputContainerStyle","labelStyle","swapButtonContainerStyle","swapButtonStyle","swapIconStyle","departureRowStyle","searchButtonStyle","searchIconStyle","dateRangePickerOuterContainerStyle","dateRangePickerLabelStyle","dateRangePickerInputGroupStyle","dateRangePickerCalendarContainerStyle","suggestionListContainerStyle","suggestionItemGroupStyle","suggestionCityRowStyle","suggestionCityIconStyle","suggestionCityTextStyle","suggestionAirportTouchableStyle","suggestionAirportIconStyle","suggestionAirportTextStyle","theme","isRTL","styles","themedStyles","toLocationInput","fromLocationInput","fromLocation","setFromLocation","toLocation","setToLocation","departureDate","setDepartureDate","returnDate","setReturnDate","focusedInput","setFocusedInput","handleSwap","currentFrom","currentTo","handleSearch","from","to","departure","return","undefined","suggestionRenderItem","item","style","suggestionItemGroup","children","suggestionCityRow","name","size","color","primary","suggestionCityIcon","suggestionCityText","city","airports","map","airport","index","suggestionAirportTouchable","onPress","FLIGHT_TO","current","blur","suggestionAirportIcon","suggestionAirportText","id","container","inputGroupContainer","inputWrapper","ref","onChangeText","text","label","value","placeholder","onFocus","FLIGHT_FROM","onBlur","setTimeout","data","visible","renderItemContent","swapButtonContainer","swapButton","activeOpacity","onSurface","departureRow","outerContainerStyle","dateRangePickerOuterContainer","inputGroupStyle","calendarContainerStyle","onDatesChange","d","searchButton","onPrimary","create","padding","backgroundColor","surface","borderBottomRightRadius","borderBottomLeftRadius","position","marginBottom","labelText","fontSize","fontWeight","textTransform","textAlign","alignItems","width","height","borderRadius","borderColor","border","borderWidth","justifyContent","flexDirection","marginTop","gap","flex","paddingVertical","paddingHorizontal","borderBottomWidth","hairlineWidth","borderBottomColor","marginLeft","onSurfaceVariant"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/TravelBooking/FlightForm.tsx"],"mappings":";;AAAA,SAAoBA,QAAQ,QAAQ,SAAS;AAC7C,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SACEC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,QAIL,cAAc;AACrB,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,WAAW,MAAM,mBAAgB;AACxC,OAAOC,eAAe,MAAM,uCAAoC;AAChE,OAAOC,cAAc,MAAM,kCAA+B;AAC1D,SAA4BC,aAAa,QAAQ,YAAS;;AAG1D;;AAGA;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAkEA;AACA,MAAMC,UAAqC,GAAGA,CAAC;EAC7CC,mBAAmB,GAAG,gCAAgC;EACtDC,iBAAiB,GAAG,8BAA8B;EAClDC,oBAAoB;EACpBC,iBAAiB;EACjBC,WAAW;EACXC,aAAa;EACbC,YAAY;EACZC,YAAY;EACZC,SAAS,GAAG,MAAM;EAClBC,OAAO,GAAG,IAAI;EACdC,eAAe,GAAG,aAAa;EAC/BC,aAAa,GAAG,WAAW;EAC3BC,cAAc,GAAG,WAAW;EAC5BC,WAAW,GAAG,QAAQ;EACtBC,YAAY,GAAG,iBAAiB;EAChCC,cAAc,GAAG,QAAQ;EACzBC,sBAAsB,GAAG,CAAC,CAAC;EAC3BC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;IAC3CC,iBAAiB,EAAE5G,KAAK,CAACiG,MAAM;IAC/BhB,eAAe,EAAEjF,KAAK,CAACkF;EACzB,CAAC;EACDpD,iBAAiB,EAAE;IACjBsE,aAAa,EAAE,KAAK;IACpBR,UAAU,EAAE,QAAQ;IACpBU,GAAG,EAAE,EAAE;IACPhB,YAAY,EAAE;EAChB,CAAC;EACDnD,kBAAkB,EAAE,CACpB,CAAC;EACDC,kBAAkB,EAAE;IAClBoD,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBxD,KAAK,EAAEjC,KAAK,CAACqE;EACf,CAAC;EACD3B,0BAA0B,EAAE;IAC1B0D,aAAa,EAAE,KAAK;IACpBR,UAAU,EAAE,QAAQ;IACpBU,GAAG,EAAE,EAAE;IACPE,eAAe,EAAE,CAAC;IAClBK,UAAU,EAAE;EACd,CAAC;EACD9D,qBAAqB,EAAE,CACvB,CAAC;EACDC,qBAAqB,EAAE;IACrBwC,QAAQ,EAAE,EAAE;IACZvD,KAAK,EAAEjC,KAAK,CAAC8G;EACf;AACF,CAAC,CAAC;AAEJ,eAAezJ,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useTheme } from "@/theme";
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
|
+
import { StyleSheet, Text, TouchableOpacity, View
|
|
6
|
+
|
|
7
|
+
// Import TextStyle
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import { NumericStepper } from "../NumericStepper/index.js";
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
+
const DEFAULT_PASSENGERS = [{
|
|
12
|
+
key: "adults",
|
|
13
|
+
name: "Adults",
|
|
14
|
+
description: "12+ years old",
|
|
15
|
+
defaultValue: 1,
|
|
16
|
+
minValue: 1,
|
|
17
|
+
maxValue: 9
|
|
18
|
+
}, {
|
|
19
|
+
key: "children",
|
|
20
|
+
name: "Children",
|
|
21
|
+
description: "2 - 11 years old",
|
|
22
|
+
defaultValue: 0,
|
|
23
|
+
minValue: 0,
|
|
24
|
+
maxValue: 9
|
|
25
|
+
}, {
|
|
26
|
+
key: "infants",
|
|
27
|
+
name: "Infants",
|
|
28
|
+
description: "0 - 1 years old",
|
|
29
|
+
defaultValue: 0,
|
|
30
|
+
minValue: 0,
|
|
31
|
+
maxValue: 9
|
|
32
|
+
}];
|
|
33
|
+
const DEFAULT_FLIGHT_TYPES = ["Round trip", "One way"];
|
|
34
|
+
const DEFAULT_FLIGHT_CLASSES = ["Economy", "Business", "First"];
|
|
35
|
+
const getInitialPassengerCounts = config => {
|
|
36
|
+
return config.reduce((acc, passenger) => {
|
|
37
|
+
acc[passenger.key] = passenger.defaultValue;
|
|
38
|
+
return acc;
|
|
39
|
+
}, {});
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// --- Component Props ---
|
|
43
|
+
|
|
44
|
+
// --- Component Implementation ---
|
|
45
|
+
const FlightSummary = ({
|
|
46
|
+
// Data
|
|
47
|
+
passengersData: passengersProp = DEFAULT_PASSENGERS,
|
|
48
|
+
flightTypesData: flightTypesProp = DEFAULT_FLIGHT_TYPES,
|
|
49
|
+
flightClassesData: flightClassesProp = DEFAULT_FLIGHT_CLASSES,
|
|
50
|
+
// State & Callbacks
|
|
51
|
+
selection,
|
|
52
|
+
onSelectionChange,
|
|
53
|
+
// Styles
|
|
54
|
+
containerStyle,
|
|
55
|
+
buttonGroupContainerStyle,
|
|
56
|
+
buttonStyle,
|
|
57
|
+
selectedButtonStyle,
|
|
58
|
+
buttonTextStyle,
|
|
59
|
+
selectedButtonTextStyle,
|
|
60
|
+
passengerSectionStyle,
|
|
61
|
+
passengerRowStyle,
|
|
62
|
+
passengerLabelContainerStyle,
|
|
63
|
+
passengerNameStyle,
|
|
64
|
+
passengerDescriptionStyle,
|
|
65
|
+
stepperContainerStyle,
|
|
66
|
+
stepperButtonStyle,
|
|
67
|
+
stepperButtonTextStyle,
|
|
68
|
+
stepperValueTextStyle
|
|
69
|
+
}) => {
|
|
70
|
+
const {
|
|
71
|
+
theme,
|
|
72
|
+
isRTL
|
|
73
|
+
} = useTheme();
|
|
74
|
+
const styles = useMemo(() => themedStyles(theme, isRTL), [theme, isRTL]);
|
|
75
|
+
const passengersConfig = useMemo(() => passengersProp, [passengersProp]);
|
|
76
|
+
const flightTypes = useMemo(() => flightTypesProp, [flightTypesProp]);
|
|
77
|
+
const flightClasses = useMemo(() => flightClassesProp, [flightClassesProp]);
|
|
78
|
+
const [selectedFlightType, setSelectedFlightType] = useState(selection?.flightType ?? flightTypes[0]);
|
|
79
|
+
const [selectedFlightClass, setSelectedFlightClass] = useState(selection?.flightClass ?? flightClasses[0]);
|
|
80
|
+
const [passengerCounts, setPassengerCounts] = useState(selection?.passengers ?? getInitialPassengerCounts(passengersConfig));
|
|
81
|
+
const handleFlightTypeSelect = useCallback(type => {
|
|
82
|
+
setSelectedFlightType(type);
|
|
83
|
+
const newState = {
|
|
84
|
+
flightType: type,
|
|
85
|
+
flightClass: selectedFlightClass,
|
|
86
|
+
passengers: passengerCounts
|
|
87
|
+
};
|
|
88
|
+
onSelectionChange?.(newState);
|
|
89
|
+
}, [selectedFlightClass, passengerCounts, onSelectionChange]);
|
|
90
|
+
const handlePassengerChange = useCallback((passengerKey, action) => {
|
|
91
|
+
setPassengerCounts(prevCounts => {
|
|
92
|
+
const passengerInfo = passengersConfig.find(p => p.key === passengerKey);
|
|
93
|
+
if (!passengerInfo) return prevCounts;
|
|
94
|
+
const currentVal = prevCounts[passengerKey];
|
|
95
|
+
const minValue = passengerInfo.minValue;
|
|
96
|
+
const maxValue = passengerInfo.maxValue ?? 99;
|
|
97
|
+
let newValue = currentVal;
|
|
98
|
+
if (action === "increment") {
|
|
99
|
+
newValue = Math.min(maxValue, currentVal + 1);
|
|
100
|
+
} else if (action === "decrement") {
|
|
101
|
+
newValue = Math.max(minValue, currentVal - 1);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// Only update if value changed
|
|
105
|
+
if (newValue === currentVal) {
|
|
106
|
+
return prevCounts;
|
|
107
|
+
}
|
|
108
|
+
const newCounts = {
|
|
109
|
+
...prevCounts,
|
|
110
|
+
[passengerKey]: newValue
|
|
111
|
+
};
|
|
112
|
+
const newState = {
|
|
113
|
+
flightType: selectedFlightType,
|
|
114
|
+
flightClass: selectedFlightClass,
|
|
115
|
+
passengers: newCounts
|
|
116
|
+
};
|
|
117
|
+
onSelectionChange?.(newState);
|
|
118
|
+
return newCounts;
|
|
119
|
+
});
|
|
120
|
+
}, [passengersConfig, selectedFlightType, selectedFlightClass, onSelectionChange
|
|
121
|
+
// No dependency on passengerCounts due to updater function usage
|
|
122
|
+
]);
|
|
123
|
+
const handleFlightClassSelect = useCallback(fClass => {
|
|
124
|
+
setSelectedFlightClass(fClass);
|
|
125
|
+
const newState = {
|
|
126
|
+
flightType: selectedFlightType,
|
|
127
|
+
flightClass: fClass,
|
|
128
|
+
passengers: passengerCounts
|
|
129
|
+
};
|
|
130
|
+
onSelectionChange?.(newState);
|
|
131
|
+
}, [selectedFlightType, passengerCounts, onSelectionChange]);
|
|
132
|
+
|
|
133
|
+
// --- Render Helpers ---
|
|
134
|
+
const renderButtonGroup = (items, selectedValue, onSelect) => /*#__PURE__*/_jsx(View, {
|
|
135
|
+
style: [styles.buttonGroupContainer, buttonGroupContainerStyle],
|
|
136
|
+
children: items.map(item => {
|
|
137
|
+
const isSelected = item === selectedValue;
|
|
138
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
139
|
+
style: [styles.button, buttonStyle, isSelected && styles.selectedButton, isSelected && selectedButtonStyle],
|
|
140
|
+
onPress: () => onSelect(item),
|
|
141
|
+
activeOpacity: 0.7,
|
|
142
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
143
|
+
style: [styles.buttonText, buttonTextStyle, isSelected && styles.selectedButtonText, isSelected && selectedButtonTextStyle],
|
|
144
|
+
children: item
|
|
145
|
+
})
|
|
146
|
+
}, item);
|
|
147
|
+
})
|
|
148
|
+
});
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
onSelectionChange?.({
|
|
151
|
+
flightType: selectedFlightType,
|
|
152
|
+
flightClass: selectedFlightClass,
|
|
153
|
+
passengers: passengerCounts
|
|
154
|
+
});
|
|
155
|
+
}, []);
|
|
156
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
157
|
+
style: [styles.container, containerStyle],
|
|
158
|
+
children: [renderButtonGroup(flightTypes, selectedFlightType, handleFlightTypeSelect), /*#__PURE__*/_jsx(View, {
|
|
159
|
+
style: [styles.passengerSection, passengerSectionStyle],
|
|
160
|
+
children: passengersConfig.map(passenger => /*#__PURE__*/_jsxs(View, {
|
|
161
|
+
style: [styles.passengerRow, passengerRowStyle],
|
|
162
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
163
|
+
style: [styles.passengerLabelContainer, passengerLabelContainerStyle],
|
|
164
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
165
|
+
style: [styles.passengerName, passengerNameStyle],
|
|
166
|
+
children: passenger.name
|
|
167
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
168
|
+
style: [styles.passengerDescription, passengerDescriptionStyle],
|
|
169
|
+
children: passenger.description
|
|
170
|
+
})]
|
|
171
|
+
}), /*#__PURE__*/_jsx(NumericStepper, {
|
|
172
|
+
value: passengerCounts[passenger.key],
|
|
173
|
+
minValue: passenger.minValue,
|
|
174
|
+
maxValue: passenger.maxValue ?? 99,
|
|
175
|
+
onIncrement: () => handlePassengerChange(passenger.key, "increment"),
|
|
176
|
+
onDecrement: () => handlePassengerChange(passenger.key, "decrement")
|
|
177
|
+
// Pass through stepper styles
|
|
178
|
+
,
|
|
179
|
+
style: stepperContainerStyle,
|
|
180
|
+
buttonStyle: stepperButtonStyle,
|
|
181
|
+
buttonTextStyle: stepperButtonTextStyle,
|
|
182
|
+
valueTextStyle: stepperValueTextStyle
|
|
183
|
+
})]
|
|
184
|
+
}, passenger.key))
|
|
185
|
+
}), renderButtonGroup(flightClasses, selectedFlightClass, handleFlightClassSelect)]
|
|
186
|
+
});
|
|
187
|
+
};
|
|
188
|
+
const themedStyles = (theme, isRTL) => StyleSheet.create({
|
|
189
|
+
container: {
|
|
190
|
+
backgroundColor: theme.surface,
|
|
191
|
+
padding: 16
|
|
192
|
+
},
|
|
193
|
+
buttonGroupContainer: {
|
|
194
|
+
flexDirection: isRTL ? "row-reverse" : "row",
|
|
195
|
+
// marginBottom: 10,
|
|
196
|
+
marginTop: 5,
|
|
197
|
+
justifyContent: "flex-start",
|
|
198
|
+
flexWrap: "wrap",
|
|
199
|
+
gap: 8
|
|
200
|
+
},
|
|
201
|
+
button: {
|
|
202
|
+
paddingVertical: 8,
|
|
203
|
+
paddingHorizontal: 16,
|
|
204
|
+
borderRadius: 16,
|
|
205
|
+
borderWidth: 1,
|
|
206
|
+
borderColor: theme.border,
|
|
207
|
+
backgroundColor: theme.surface
|
|
208
|
+
},
|
|
209
|
+
selectedButton: {
|
|
210
|
+
borderColor: theme.primary,
|
|
211
|
+
backgroundColor: theme.primary
|
|
212
|
+
},
|
|
213
|
+
buttonText: {
|
|
214
|
+
color: theme.onSurface,
|
|
215
|
+
fontWeight: "500",
|
|
216
|
+
fontSize: 14
|
|
217
|
+
},
|
|
218
|
+
selectedButtonText: {
|
|
219
|
+
color: theme.onPrimary,
|
|
220
|
+
fontWeight: "bold",
|
|
221
|
+
fontSize: 14
|
|
222
|
+
},
|
|
223
|
+
passengerSection: {
|
|
224
|
+
marginVertical: 15
|
|
225
|
+
},
|
|
226
|
+
passengerRow: {
|
|
227
|
+
flexDirection: isRTL ? "row-reverse" : "row",
|
|
228
|
+
justifyContent: "space-between",
|
|
229
|
+
alignItems: "center",
|
|
230
|
+
paddingVertical: 10,
|
|
231
|
+
borderBottomWidth: StyleSheet.hairlineWidth,
|
|
232
|
+
borderBottomColor: theme.divider
|
|
233
|
+
// Remove width: '100%' unless absolutely necessary
|
|
234
|
+
},
|
|
235
|
+
passengerLabelContainer: {
|
|
236
|
+
flexDirection: "column",
|
|
237
|
+
alignItems: isRTL ? "flex-end" : "flex-start",
|
|
238
|
+
flexShrink: 1,
|
|
239
|
+
marginRight: isRTL ? 0 : 8,
|
|
240
|
+
marginLeft: isRTL ? 8 : 0
|
|
241
|
+
},
|
|
242
|
+
passengerName: {
|
|
243
|
+
fontSize: 16,
|
|
244
|
+
fontWeight: "bold",
|
|
245
|
+
color: theme.onSurface
|
|
246
|
+
},
|
|
247
|
+
passengerDescription: {
|
|
248
|
+
fontSize: 12,
|
|
249
|
+
color: theme.secondaryText || theme.onSurface,
|
|
250
|
+
opacity: 0.8
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
export default FlightSummary;
|
|
254
|
+
//# sourceMappingURL=FlightSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useTheme","React","useCallback","useEffect","useMemo","useState","StyleSheet","Text","TouchableOpacity","View","NumericStepper","jsx","_jsx","jsxs","_jsxs","DEFAULT_PASSENGERS","key","name","description","defaultValue","minValue","maxValue","DEFAULT_FLIGHT_TYPES","DEFAULT_FLIGHT_CLASSES","getInitialPassengerCounts","config","reduce","acc","passenger","FlightSummary","passengersData","passengersProp","flightTypesData","flightTypesProp","flightClassesData","flightClassesProp","selection","onSelectionChange","containerStyle","buttonGroupContainerStyle","buttonStyle","selectedButtonStyle","buttonTextStyle","selectedButtonTextStyle","passengerSectionStyle","passengerRowStyle","passengerLabelContainerStyle","passengerNameStyle","passengerDescriptionStyle","stepperContainerStyle","stepperButtonStyle","stepperButtonTextStyle","stepperValueTextStyle","theme","isRTL","styles","themedStyles","passengersConfig","flightTypes","flightClasses","selectedFlightType","setSelectedFlightType","flightType","selectedFlightClass","setSelectedFlightClass","flightClass","passengerCounts","setPassengerCounts","passengers","handleFlightTypeSelect","type","newState","handlePassengerChange","passengerKey","action","prevCounts","passengerInfo","find","p","currentVal","newValue","Math","min","max","newCounts","handleFlightClassSelect","fClass","renderButtonGroup","items","selectedValue","onSelect","style","buttonGroupContainer","children","map","item","isSelected","button","selectedButton","onPress","activeOpacity","buttonText","selectedButtonText","container","passengerSection","passengerRow","passengerLabelContainer","passengerName","passengerDescription","value","onIncrement","onDecrement","valueTextStyle","create","backgroundColor","surface","padding","flexDirection","marginTop","justifyContent","flexWrap","gap","paddingVertical","paddingHorizontal","borderRadius","borderWidth","borderColor","border","primary","color","onSurface","fontWeight","fontSize","onPrimary","marginVertical","alignItems","borderBottomWidth","hairlineWidth","borderBottomColor","divider","flexShrink","marginRight","marginLeft","secondaryText","opacity"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/TravelBooking/FlightSummary.tsx"],"mappings":";;AAAA,SAAoBA,QAAQ,QAAQ,SAAS;AAC7C,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACxE,SAEEC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC;;AAEW;AAAA,OACN,cAAc;AACrB,SAASC,cAAc,QAA6B,4BAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAiBxE,MAAMC,kBAAqC,GAAG,CAC5C;EACEC,GAAG,EAAE,QAAQ;EACbC,IAAI,EAAE,QAAQ;EACdC,WAAW,EAAE,eAAe;EAC5BC,YAAY,EAAE,CAAC;EACfC,QAAQ,EAAE,CAAC;EACXC,QAAQ,EAAE;AACZ,CAAC,EACD;EACEL,GAAG,EAAE,UAAU;EACfC,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,kBAAkB;EAC/BC,YAAY,EAAE,CAAC;EACfC,QAAQ,EAAE,CAAC;EACXC,QAAQ,EAAE;AACZ,CAAC,EACD;EACEL,GAAG,EAAE,SAAS;EACdC,IAAI,EAAE,SAAS;EACfC,WAAW,EAAE,iBAAiB;EAC9BC,YAAY,EAAE,CAAC;EACfC,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