related-ui-components 2.4.8 → 2.4.9
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/module/app.js +86 -121
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Input/PhoneInput.js +178 -0
- package/lib/module/components/Input/PhoneInput.js.map +1 -0
- package/lib/module/components/Input/index.js +2 -0
- package/lib/module/components/Input/index.js.map +1 -1
- package/lib/module/contexts/BottomSheetStackContext.js +12 -0
- package/lib/module/contexts/BottomSheetStackContext.js.map +1 -0
- package/lib/module/contexts/BottomSheetStackProvider.js +111 -0
- package/lib/module/contexts/BottomSheetStackProvider.js.map +1 -0
- package/lib/module/contexts/index.js +2 -2
- package/lib/module/contexts/index.js.map +1 -1
- package/lib/module/utils/flags.js +6 -0
- package/lib/module/utils/flags.js.map +1 -0
- package/lib/typescript/src/app.d.ts +3 -1
- package/lib/typescript/src/app.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/PhoneInput.d.ts +22 -0
- package/lib/typescript/src/components/Input/PhoneInput.d.ts.map +1 -0
- package/lib/typescript/src/components/Input/index.d.ts +2 -0
- package/lib/typescript/src/components/Input/index.d.ts.map +1 -1
- package/lib/typescript/src/contexts/BottomSheetStackContext.d.ts +16 -0
- package/lib/typescript/src/contexts/BottomSheetStackContext.d.ts.map +1 -0
- package/lib/typescript/src/contexts/BottomSheetStackProvider.d.ts +5 -0
- package/lib/typescript/src/contexts/BottomSheetStackProvider.d.ts.map +1 -0
- package/lib/typescript/src/contexts/index.d.ts +2 -2
- package/lib/typescript/src/contexts/index.d.ts.map +1 -1
- package/lib/typescript/src/utils/flags.d.ts +2 -0
- package/lib/typescript/src/utils/flags.d.ts.map +1 -0
- package/package.json +4 -1
- package/src/app.tsx +134 -116
- package/src/components/Input/PhoneInput.tsx +214 -0
- package/src/components/Input/index.ts +4 -1
- package/src/contexts/BottomSheetStackContext.tsx +30 -0
- package/src/contexts/BottomSheetStackProvider.tsx +138 -0
- package/src/contexts/index.ts +2 -2
- package/src/utils/flags.ts +7 -0
- package/lib/module/contexts/BottomSheetContext.js +0 -13
- package/lib/module/contexts/BottomSheetContext.js.map +0 -1
- package/lib/module/contexts/BottomSheetProvider.js +0 -104
- package/lib/module/contexts/BottomSheetProvider.js.map +0 -1
- package/lib/typescript/src/contexts/BottomSheetContext.d.ts +0 -10
- package/lib/typescript/src/contexts/BottomSheetContext.d.ts.map +0 -1
- package/lib/typescript/src/contexts/BottomSheetProvider.d.ts +0 -7
- package/lib/typescript/src/contexts/BottomSheetProvider.d.ts.map +0 -1
- package/src/contexts/BottomSheetContext.tsx +0 -28
- package/src/contexts/BottomSheetProvider.tsx +0 -136
package/lib/module/app.js
CHANGED
|
@@ -1,124 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
// import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
|
|
3
|
-
// import CarouselCardStack from "./components/CarouselCardStack/CarouselCardStack"; // Adjust path as needed
|
|
4
|
-
// import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
5
|
-
// import { CarRentalForm, DateRangePicker, FlightForm, FlightSummary, HotelForm, HotelSummary, Filters} from "./components";
|
|
6
|
-
// import { lightTheme, RelatedProvider, useTheme } from "./theme";
|
|
7
|
-
// import CircularProgressBar from "./components/ProgressBar/CircularProgressBar";
|
|
8
|
-
|
|
9
|
-
// // Sample data - replace with your actual image URLs
|
|
10
|
-
// const DUMMY_DATA = [
|
|
11
|
-
// {
|
|
12
|
-
// id: "1",
|
|
13
|
-
// image:
|
|
14
|
-
// "https://images.pexels.com/photos/3354648/pexels-photo-3354648.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
15
|
-
// title: "Mountain Lake",
|
|
16
|
-
// },
|
|
17
|
-
// // {
|
|
18
|
-
// // id: "2",
|
|
19
|
-
// // image:
|
|
20
|
-
// // "https://images.pexels.com/photos/163273/sunrise-speedboat-ocean-water-163273.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
21
|
-
// // title: "Sunset Cruise",
|
|
22
|
-
// // },
|
|
23
|
-
// {
|
|
24
|
-
// id: "3",
|
|
25
|
-
// image:
|
|
26
|
-
// "https://images.pexels.com/photos/1430677/pexels-photo-1430677.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
27
|
-
// title: "Ocean Horizon",
|
|
28
|
-
// },
|
|
29
|
-
// {
|
|
30
|
-
// id: "4",
|
|
31
|
-
// image:
|
|
32
|
-
// "https://images.pexels.com/photos/2387793/pexels-photo-2387793.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
33
|
-
// title: "Forest Trail",
|
|
34
|
-
// },
|
|
35
|
-
// // {
|
|
36
|
-
// // id: "5",
|
|
37
|
-
// // image:
|
|
38
|
-
// // "https://images.pexels.com/photos/302804/pexels-photo-302804.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
39
|
-
// // title: "City Lights",
|
|
40
|
-
// // },
|
|
41
|
-
// ];
|
|
42
|
-
|
|
43
|
-
// const App = () => {
|
|
44
|
-
// const { theme } = useTheme();
|
|
45
|
-
|
|
46
|
-
// const [departureDate, setDepartureDate] = useState<string | undefined>(undefined);
|
|
47
|
-
// const [returnDate, setReturnDate] = useState<string | undefined>(undefined);
|
|
48
|
-
|
|
49
|
-
// const [progress, setProgress] = useState(25);
|
|
50
|
-
// const handleAnimate = () => {
|
|
51
|
-
// // Set progress to a new random value between 0 and 100
|
|
52
|
-
// const newProgress = Math.floor(Math.random() * 101);
|
|
53
|
-
// setProgress(newProgress);
|
|
54
|
-
// };
|
|
55
|
-
// return (
|
|
56
|
-
// <>
|
|
57
|
-
// <RelatedProvider theme={lightTheme}>
|
|
58
|
-
// <GestureHandlerRootView style={{ flex: 1 }}>
|
|
59
|
-
// <StatusBar barStyle="light-content" />
|
|
60
|
-
// <SafeAreaView style={styles.appContainer}>
|
|
61
|
-
// <CircularProgressBar
|
|
62
|
-
// progress={5}
|
|
63
|
-
// lineCap="round"
|
|
64
|
-
// textFont={""}
|
|
65
|
-
// />
|
|
66
|
-
// {/* <DateRangePicker
|
|
67
|
-
// onDatesChange={(t) => {
|
|
68
|
-
// setDepartureDate(t.departure);
|
|
69
|
-
// setReturnDate(t.return);
|
|
70
|
-
// }}
|
|
71
|
-
// departureDate={departureDate}
|
|
72
|
-
// // departureDisplayValue={departureDate}
|
|
73
|
-
// returnDate={returnDate}
|
|
74
|
-
// // returnDisplayValue={returnDate}
|
|
75
|
-
// ></DateRangePicker> */}
|
|
76
|
-
// {/* <Filters
|
|
77
|
-
// bottomSheetBackgroundStyle={{
|
|
78
|
-
// borderTopRightRadius: 30,
|
|
79
|
-
// borderTopLeftRadius: 30,
|
|
80
|
-
// padding: 10,
|
|
81
|
-
// backgroundColor: "white",
|
|
82
|
-
// }}
|
|
83
|
-
// containerStyle={{
|
|
84
|
-
// backgroundColor: "white",
|
|
85
|
-
// borderTopRightRadius: 60,
|
|
86
|
-
// borderTopLeftRadius: 60,
|
|
87
|
-
// }}
|
|
88
|
-
// resetTextStyle={{ color: theme.primary }}
|
|
89
|
-
// sectionTitleStyle={{ color: "black" }}
|
|
90
|
-
// titleStyle={{ color: "black" }}
|
|
91
|
-
// onActionButtonPress={(result) => {
|
|
92
|
-
// // setFiltersResult(result);
|
|
93
|
-
// }}
|
|
94
|
-
// sortOptions={[{ id: 1, name: "test", value: "test" }]}
|
|
95
|
-
// // onClose={() => setDisplayFilters(false)}
|
|
96
|
-
// applyButtonStyle={{ borderRadius: 8, backgroundColor: "black" }}
|
|
97
|
-
// applyButtonTextStyle={{ color: theme.secondary }}
|
|
98
|
-
// headerStyle={{ borderBottomWidth: 0 }}
|
|
99
|
-
// ></Filters> */}
|
|
100
|
-
// {/* <FlightSummary></FlightSummary> */}
|
|
101
|
-
// {/* <FlightForm></FlightForm> */}
|
|
102
|
-
// {/* <HotelSummary></HotelSummary> */}
|
|
103
|
-
// {/* <HotelForm></HotelForm> */}
|
|
104
|
-
// {/* <DateRangePicker onDatesChange={()=>{}} labelContainerStyle={{backgroundColor:"red"}}></DateRangePicker> */}
|
|
105
|
-
// {/* <CarRentalForm onSelectionChange={console.log}></CarRentalForm> */}
|
|
106
|
-
// <CarouselCardStack data={DUMMY_DATA} />
|
|
107
|
-
// </SafeAreaView>
|
|
108
|
-
// </GestureHandlerRootView>
|
|
109
|
-
// </RelatedProvider>
|
|
110
|
-
// </>
|
|
111
|
-
// );
|
|
112
|
-
// };
|
|
1
|
+
"use strict";
|
|
113
2
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
//
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
|
|
5
|
+
// Adjust path as needed
|
|
6
|
+
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
7
|
+
import { lightTheme, RelatedProvider, useTheme } from "./theme/index.js";
|
|
8
|
+
import PhoneInput from "./components/Input/PhoneInput.js";
|
|
9
|
+
import { BottomSheetStackProvider } from "./contexts/index.js";
|
|
10
|
+
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
121
11
|
|
|
122
|
-
//
|
|
123
|
-
|
|
12
|
+
// Sample data - replace with your actual image URLs
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
14
|
+
const DUMMY_DATA = [{
|
|
15
|
+
id: "1",
|
|
16
|
+
image: "https://images.pexels.com/photos/3354648/pexels-photo-3354648.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
17
|
+
title: "Mountain Lake"
|
|
18
|
+
},
|
|
19
|
+
// {
|
|
20
|
+
// id: "2",
|
|
21
|
+
// image:
|
|
22
|
+
// "https://images.pexels.com/photos/163273/sunrise-speedboat-ocean-water-163273.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
23
|
+
// title: "Sunset Cruise",
|
|
24
|
+
// },
|
|
25
|
+
{
|
|
26
|
+
id: "3",
|
|
27
|
+
image: "https://images.pexels.com/photos/1430677/pexels-photo-1430677.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
28
|
+
title: "Ocean Horizon"
|
|
29
|
+
}, {
|
|
30
|
+
id: "4",
|
|
31
|
+
image: "https://images.pexels.com/photos/2387793/pexels-photo-2387793.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
32
|
+
title: "Forest Trail"
|
|
33
|
+
}
|
|
34
|
+
// {
|
|
35
|
+
// id: "5",
|
|
36
|
+
// image:
|
|
37
|
+
// "https://images.pexels.com/photos/302804/pexels-photo-302804.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
|
|
38
|
+
// title: "City Lights",
|
|
39
|
+
// },
|
|
40
|
+
];
|
|
41
|
+
const App = () => {
|
|
42
|
+
const {
|
|
43
|
+
theme
|
|
44
|
+
} = useTheme();
|
|
45
|
+
const [departureDate, setDepartureDate] = useState(undefined);
|
|
46
|
+
const [returnDate, setReturnDate] = useState(undefined);
|
|
47
|
+
const [progress, setProgress] = useState(25);
|
|
48
|
+
const handleAnimate = () => {
|
|
49
|
+
// Set progress to a new random value between 0 and 100
|
|
50
|
+
const newProgress = Math.floor(Math.random() * 101);
|
|
51
|
+
setProgress(newProgress);
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
54
|
+
children: /*#__PURE__*/_jsx(SafeAreaProvider, {
|
|
55
|
+
children: /*#__PURE__*/_jsx(GestureHandlerRootView, {
|
|
56
|
+
style: {
|
|
57
|
+
flex: 1
|
|
58
|
+
},
|
|
59
|
+
children: /*#__PURE__*/_jsx(RelatedProvider, {
|
|
60
|
+
theme: lightTheme,
|
|
61
|
+
children: /*#__PURE__*/_jsxs(BottomSheetStackProvider, {
|
|
62
|
+
children: [/*#__PURE__*/_jsx(StatusBar, {
|
|
63
|
+
barStyle: "light-content"
|
|
64
|
+
}), /*#__PURE__*/_jsx(SafeAreaView, {
|
|
65
|
+
style: styles.appContainer,
|
|
66
|
+
children: /*#__PURE__*/_jsx(PhoneInput, {
|
|
67
|
+
value: "",
|
|
68
|
+
onChangeText: () => {},
|
|
69
|
+
inputContainerStyle: {
|
|
70
|
+
height: 55
|
|
71
|
+
}
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
const styles = StyleSheet.create({
|
|
81
|
+
appContainer: {
|
|
82
|
+
flex: 1,
|
|
83
|
+
backgroundColor: "#212121",
|
|
84
|
+
// Match carousel background or choose another
|
|
85
|
+
justifyContent: "center" // Center the carousel vertically if it's the main content
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
export default App;
|
|
124
89
|
//# sourceMappingURL=app.js.map
|
package/lib/module/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"names":["React","useState","SafeAreaView","StyleSheet","StatusBar","GestureHandlerRootView","lightTheme","RelatedProvider","useTheme","PhoneInput","BottomSheetStackProvider","SafeAreaProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DUMMY_DATA","id","image","title","App","theme","departureDate","setDepartureDate","undefined","returnDate","setReturnDate","progress","setProgress","handleAnimate","newProgress","Math","floor","random","children","style","flex","barStyle","styles","appContainer","value","onChangeText","inputContainerStyle","height","create","backgroundColor","justifyContent"],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAQ,cAAc;AACgB;AAClF,SAASC,sBAAsB,QAAQ,8BAA8B;A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R,sBAAsB;QAACgC,KAAK,EAAE;UAAEC,IAAI,EAAE;QAAE,CAAE;QAAAF,QAAA,eACzCvB,IAAA,CAACN,eAAe;UAACgB,KAAK,EAAEjB,UAAW;UAAA8B,QAAA,eACjCrB,KAAA,CAACL,wBAAwB;YAAA0B,QAAA,gBACvBvB,IAAA,CAACT,SAAS;cAACmC,QAAQ,EAAC;YAAe,CAAE,CAAC,eACtC1B,IAAA,CAACX,YAAY;cAACmC,KAAK,EAAEG,MAAM,CAACC,YAAa;cAAAL,QAAA,eA+CvCvB,IAAA,CAACJ,UAAU;gBAACiC,KAAK,EAAC,EAAE;gBAACC,YAAY,EAAEA,CAAA,KAAM,CAAC,CAAE;gBAACC,mBAAmB,EAAE;kBAACC,MAAM,EAAE;gBAAE;cAAE,CAAa;YAAC,CACjF,CAAC;UAAA,CACS;QAAC,CACZ;MAAC,CACI;IAAC,CACP;EAAC,CACnB,CAAC;AAEP,CAAC;AAED,MAAML,MAAM,GAAGrC,UAAU,CAAC2C,MAAM,CAAC;EAC/BL,YAAY,EAAE;IACZH,IAAI,EAAE,CAAC;IACPS,eAAe,EAAE,SAAS;IAAE;IAC5BC,cAAc,EAAE,QAAQ,CAAE;EAC5B;AACF,CAAC,CAAC;AAEF,eAAe1B,GAAG","ignoreList":[]}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { forwardRef, useMemo, useCallback } from "react";
|
|
4
|
+
import { Text, View, TouchableOpacity, StyleSheet } from "react-native";
|
|
5
|
+
import CustomInput from "./Input.js";
|
|
6
|
+
import { useTheme } from "../../theme/index.js";
|
|
7
|
+
import { Ionicons } from "@expo/vector-icons";
|
|
8
|
+
import { useBottomSheetStack } from "../../contexts/index.js";
|
|
9
|
+
import { BottomSheetFlatList } from "@gorhom/bottom-sheet";
|
|
10
|
+
import { allCountries } from 'country-telephone-data';
|
|
11
|
+
import { iso2ToFlagEmoji } from "../../utils/flags.js";
|
|
12
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
const DEFAULT_COUNTRIES = allCountries.map(c => ({
|
|
14
|
+
code: `+${c.dialCode}`,
|
|
15
|
+
iso2: c.iso2,
|
|
16
|
+
name: c.name
|
|
17
|
+
}));
|
|
18
|
+
const PhoneInput = /*#__PURE__*/forwardRef(({
|
|
19
|
+
value,
|
|
20
|
+
onChangeText,
|
|
21
|
+
selectedCountry,
|
|
22
|
+
onSelectCountry,
|
|
23
|
+
countries = DEFAULT_COUNTRIES,
|
|
24
|
+
containerStyle,
|
|
25
|
+
inputContainerStyle,
|
|
26
|
+
inputStyle,
|
|
27
|
+
label,
|
|
28
|
+
labelStyle,
|
|
29
|
+
error,
|
|
30
|
+
errorStyle,
|
|
31
|
+
helper,
|
|
32
|
+
helperStyle,
|
|
33
|
+
listTitle = "Select Country",
|
|
34
|
+
listTitleStyle,
|
|
35
|
+
countryCodeStyle,
|
|
36
|
+
countryNameStyle,
|
|
37
|
+
...rest
|
|
38
|
+
}, ref) => {
|
|
39
|
+
const {
|
|
40
|
+
theme
|
|
41
|
+
} = useTheme();
|
|
42
|
+
const {
|
|
43
|
+
push
|
|
44
|
+
} = useBottomSheetStack();
|
|
45
|
+
const sel = useMemo(() => selectedCountry || countries.find(c => c.code === "+1") || countries[0], [selectedCountry, countries]);
|
|
46
|
+
const handleCountryPress = useCallback(c => {
|
|
47
|
+
onSelectCountry && onSelectCountry(c);
|
|
48
|
+
}, [onSelectCountry]);
|
|
49
|
+
const renderCountry = ({
|
|
50
|
+
item
|
|
51
|
+
}) => /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
52
|
+
style: styles.countryRow,
|
|
53
|
+
onPress: () => handleCountryPress(item),
|
|
54
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
55
|
+
style: styles.flag,
|
|
56
|
+
children: [" ", iso2ToFlagEmoji(item.iso2)]
|
|
57
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
58
|
+
style: styles.countryText,
|
|
59
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
60
|
+
style: [styles.countryName, countryNameStyle],
|
|
61
|
+
children: item.name
|
|
62
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
63
|
+
style: [styles.countryCode, countryCodeStyle],
|
|
64
|
+
children: item.code
|
|
65
|
+
})]
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
const leftIcon = /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
69
|
+
style: [styles.selector, {
|
|
70
|
+
backgroundColor: theme.inputBackground
|
|
71
|
+
}],
|
|
72
|
+
hitSlop: {
|
|
73
|
+
left: 30,
|
|
74
|
+
top: 30,
|
|
75
|
+
right: 30,
|
|
76
|
+
bottom: 30
|
|
77
|
+
},
|
|
78
|
+
onPress: () => push({
|
|
79
|
+
component: /*#__PURE__*/_jsxs(View, {
|
|
80
|
+
style: styles.popup,
|
|
81
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
82
|
+
style: [styles.popupTitle, listTitleStyle, {
|
|
83
|
+
color: theme.text
|
|
84
|
+
}],
|
|
85
|
+
children: listTitle
|
|
86
|
+
}), /*#__PURE__*/_jsx(BottomSheetFlatList, {
|
|
87
|
+
data: countries,
|
|
88
|
+
keyExtractor: (c, i) => i.toString(),
|
|
89
|
+
renderItem: renderCountry,
|
|
90
|
+
contentContainerStyle: {
|
|
91
|
+
paddingBottom: 16
|
|
92
|
+
}
|
|
93
|
+
})]
|
|
94
|
+
}),
|
|
95
|
+
snapPoints: ["100%"]
|
|
96
|
+
}),
|
|
97
|
+
activeOpacity: 0.8,
|
|
98
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
99
|
+
style: [styles.flag, {
|
|
100
|
+
color: theme.inputText
|
|
101
|
+
}],
|
|
102
|
+
children: iso2ToFlagEmoji(sel.iso2)
|
|
103
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
104
|
+
style: [styles.code, {
|
|
105
|
+
color: theme.inputText
|
|
106
|
+
}],
|
|
107
|
+
children: sel.code
|
|
108
|
+
}), /*#__PURE__*/_jsx(Ionicons, {
|
|
109
|
+
name: "chevron-down",
|
|
110
|
+
size: 16,
|
|
111
|
+
style: {
|
|
112
|
+
marginHorizontal: 4
|
|
113
|
+
}
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
117
|
+
children: /*#__PURE__*/_jsx(CustomInput, {
|
|
118
|
+
ref: ref,
|
|
119
|
+
label: label,
|
|
120
|
+
value: value,
|
|
121
|
+
onChangeText: onChangeText,
|
|
122
|
+
keyboardType: "phone-pad",
|
|
123
|
+
placeholder: "123 456 7890",
|
|
124
|
+
leftIcon: leftIcon,
|
|
125
|
+
containerStyle: containerStyle,
|
|
126
|
+
inputContainerStyle: inputContainerStyle,
|
|
127
|
+
inputStyle: inputStyle,
|
|
128
|
+
labelStyle: labelStyle,
|
|
129
|
+
error: error,
|
|
130
|
+
errorStyle: errorStyle,
|
|
131
|
+
helper: helper,
|
|
132
|
+
helperStyle: helperStyle,
|
|
133
|
+
...rest
|
|
134
|
+
})
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
const styles = StyleSheet.create({
|
|
138
|
+
selector: {
|
|
139
|
+
flexDirection: "row",
|
|
140
|
+
alignItems: "center",
|
|
141
|
+
borderRightWidth: 1,
|
|
142
|
+
borderRightColor: "grey"
|
|
143
|
+
},
|
|
144
|
+
flag: {
|
|
145
|
+
fontSize: 18
|
|
146
|
+
},
|
|
147
|
+
code: {
|
|
148
|
+
fontSize: 14,
|
|
149
|
+
marginLeft: 4
|
|
150
|
+
},
|
|
151
|
+
popup: {
|
|
152
|
+
// maxHeight: 400,
|
|
153
|
+
width: "100%",
|
|
154
|
+
padding: 16
|
|
155
|
+
},
|
|
156
|
+
popupTitle: {
|
|
157
|
+
fontSize: 18,
|
|
158
|
+
fontWeight: "600",
|
|
159
|
+
marginBottom: 12
|
|
160
|
+
},
|
|
161
|
+
countryRow: {
|
|
162
|
+
flexDirection: "row",
|
|
163
|
+
alignItems: "center",
|
|
164
|
+
paddingVertical: 10
|
|
165
|
+
},
|
|
166
|
+
countryText: {
|
|
167
|
+
marginLeft: 12
|
|
168
|
+
},
|
|
169
|
+
countryName: {
|
|
170
|
+
fontSize: 16
|
|
171
|
+
},
|
|
172
|
+
countryCode: {
|
|
173
|
+
fontSize: 14,
|
|
174
|
+
color: "#666"
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
export default PhoneInput;
|
|
178
|
+
//# sourceMappingURL=PhoneInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","forwardRef","useMemo","useCallback","Text","View","TouchableOpacity","StyleSheet","CustomInput","useTheme","Ionicons","useBottomSheetStack","BottomSheetFlatList","allCountries","iso2ToFlagEmoji","jsxs","_jsxs","jsx","_jsx","Fragment","_Fragment","DEFAULT_COUNTRIES","map","c","code","dialCode","iso2","name","PhoneInput","value","onChangeText","selectedCountry","onSelectCountry","countries","containerStyle","inputContainerStyle","inputStyle","label","labelStyle","error","errorStyle","helper","helperStyle","listTitle","listTitleStyle","countryCodeStyle","countryNameStyle","rest","ref","theme","push","sel","find","handleCountryPress","renderCountry","item","style","styles","countryRow","onPress","children","flag","countryText","countryName","countryCode","leftIcon","selector","backgroundColor","inputBackground","hitSlop","left","top","right","bottom","component","popup","popupTitle","color","text","data","keyExtractor","i","toString","renderItem","contentContainerStyle","paddingBottom","snapPoints","activeOpacity","inputText","size","marginHorizontal","keyboardType","placeholder","create","flexDirection","alignItems","borderRightWidth","borderRightColor","fontSize","marginLeft","width","padding","fontWeight","marginBottom","paddingVertical"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/PhoneInput.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,UAAU,EAAYC,OAAO,EAAEC,WAAW,QAAQ,OAAO;AACzE,SAEEC,IAAI,EACJC,IAAI,EACJC,gBAA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KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAejD,UAAU","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","Input"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,KAAK,QAAO,YAAS;AACzC,cAAc,YAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["default","Input","PhoneInput"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/index.ts"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,KAAK,QAAO,YAAS;AACzC,cAAc,YAAS;AAEvB,SAASD,OAAO,IAAIE,UAAU,QAAO,iBAAc;AACnD,cAAc,iBAAc","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useContext } from "react";
|
|
4
|
+
export const BottomSheetStackContext = /*#__PURE__*/React.createContext(null);
|
|
5
|
+
export const useBottomSheetStack = () => {
|
|
6
|
+
const context = useContext(BottomSheetStackContext);
|
|
7
|
+
if (!context) {
|
|
8
|
+
throw new Error("useBottomSheetStack must be used within a BottomSheetStackProvider");
|
|
9
|
+
}
|
|
10
|
+
return context;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=BottomSheetStackContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useContext","BottomSheetStackContext","createContext","useBottomSheetStack","context","Error"],"sourceRoot":"..\\..\\..\\src","sources":["contexts/BottomSheetStackContext.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAeC,UAAU,QAAQ,OAAO;AAgBpD,OAAO,MAAMC,uBAAuB,gBAClCF,KAAK,CAACG,aAAa,CAAqC,IAAI,CAAC;AAE/D,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMC,OAAO,GAAGJ,UAAU,CAACC,uBAAuB,CAAC;EAEnD,IAAI,CAACG,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,oEACF,CAAC;EACH;EAEA,OAAOD,OAAO;AAChB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import BottomSheet, { BottomSheetBackdrop } from "@gorhom/bottom-sheet";
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { BackHandler, StyleSheet } from "react-native";
|
|
6
|
+
import Animated, { FadeIn, FadeOut } from "react-native-reanimated";
|
|
7
|
+
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
|
+
import { BottomSheetStackContext } from "./BottomSheetStackContext.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const BottomSheetStackProvider = ({
|
|
11
|
+
children
|
|
12
|
+
}) => {
|
|
13
|
+
const [stack, setStack] = useState([]);
|
|
14
|
+
const sheetRef = useRef(null);
|
|
15
|
+
const {
|
|
16
|
+
top
|
|
17
|
+
} = useSafeAreaInsets();
|
|
18
|
+
const push = useCallback(item => {
|
|
19
|
+
setStack(prev => [...prev, item]);
|
|
20
|
+
}, []);
|
|
21
|
+
const clear = useCallback(() => {
|
|
22
|
+
sheetRef.current?.close();
|
|
23
|
+
setStack([]);
|
|
24
|
+
}, []);
|
|
25
|
+
const pop = useCallback(() => {
|
|
26
|
+
if (stack.length <= 1) {
|
|
27
|
+
clear();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
setStack(prev => prev.slice(0, -1));
|
|
31
|
+
}, [stack.length, clear]);
|
|
32
|
+
const replace = useCallback(item => {
|
|
33
|
+
setStack(prev => [...prev.slice(0, -1), item]);
|
|
34
|
+
}, []);
|
|
35
|
+
const currentItem = useMemo(() => stack[stack.length - 1], [stack]);
|
|
36
|
+
const canGoBack = stack.length > 1;
|
|
37
|
+
const isOpen = stack.length > 0;
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (isOpen && currentItem) {
|
|
40
|
+
sheetRef.current?.snapToIndex(0);
|
|
41
|
+
}
|
|
42
|
+
const backHandlerSubscription = BackHandler.addEventListener("hardwareBackPress", () => {
|
|
43
|
+
if (canGoBack) {
|
|
44
|
+
pop();
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (!canGoBack && stack.length === 1) {
|
|
48
|
+
sheetRef.current?.close();
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
});
|
|
53
|
+
return () => backHandlerSubscription.remove();
|
|
54
|
+
}, [isOpen, canGoBack, currentItem, pop, stack]);
|
|
55
|
+
const AnimatedView = Animated.View;
|
|
56
|
+
const enteringAnimation = FadeIn.duration(200);
|
|
57
|
+
const exitingAnimation = FadeOut.duration(200);
|
|
58
|
+
const renderBackdrop = useCallback(props => /*#__PURE__*/_jsx(BottomSheetBackdrop, {
|
|
59
|
+
...props,
|
|
60
|
+
disappearsOnIndex: -1,
|
|
61
|
+
style: [props.style, {
|
|
62
|
+
backgroundColor: "rgba(0,0,0,0,1)"
|
|
63
|
+
}],
|
|
64
|
+
appearsOnIndex: 0,
|
|
65
|
+
pressBehavior: "close"
|
|
66
|
+
}), []);
|
|
67
|
+
return /*#__PURE__*/_jsxs(BottomSheetStackContext.Provider, {
|
|
68
|
+
value: {
|
|
69
|
+
push,
|
|
70
|
+
pop,
|
|
71
|
+
replace,
|
|
72
|
+
clear,
|
|
73
|
+
canGoBack
|
|
74
|
+
},
|
|
75
|
+
children: [children, /*#__PURE__*/_jsx(BottomSheet, {
|
|
76
|
+
ref: sheetRef,
|
|
77
|
+
index: 0,
|
|
78
|
+
snapPoints: currentItem?.snapPoints || ["100%"],
|
|
79
|
+
enableDynamicSizing: currentItem?.snapPoints === undefined,
|
|
80
|
+
enablePanDownToClose: true,
|
|
81
|
+
android_keyboardInputMode: "adjustResize",
|
|
82
|
+
enableBlurKeyboardOnGesture: true,
|
|
83
|
+
keyboardBlurBehavior: "restore",
|
|
84
|
+
keyboardBehavior: "fillParent",
|
|
85
|
+
onClose: clear,
|
|
86
|
+
backdropComponent: renderBackdrop,
|
|
87
|
+
topInset: top,
|
|
88
|
+
handleIndicatorStyle: {
|
|
89
|
+
backgroundColor: "#CCCCCC"
|
|
90
|
+
},
|
|
91
|
+
style: styles.sheetContainer,
|
|
92
|
+
children: currentItem && /*#__PURE__*/_jsx(AnimatedView, {
|
|
93
|
+
entering: enteringAnimation,
|
|
94
|
+
exiting: exitingAnimation,
|
|
95
|
+
style: styles.animatedView,
|
|
96
|
+
children: currentItem.component
|
|
97
|
+
}, stack.length)
|
|
98
|
+
})]
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
const styles = StyleSheet.create({
|
|
102
|
+
sheetContainer: {
|
|
103
|
+
// backgroundColor: "#FFFFFF",
|
|
104
|
+
// borderTopLeftRadius: 20,
|
|
105
|
+
// borderTopRightRadius: 20,
|
|
106
|
+
},
|
|
107
|
+
animatedView: {
|
|
108
|
+
flex: 1
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
//# sourceMappingURL=BottomSheetStackProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BottomSheet","BottomSheetBackdrop","React","useCallback","useEffect","useMemo","useRef","useState","BackHandler","StyleSheet","Animated","FadeIn","FadeOut","useSafeAreaInsets","BottomSheetStackContext","jsx","_jsx","jsxs","_jsxs","BottomSheetStackProvider","children","stack","setStack","sheetRef","top","push","item","prev","clear","current","close","pop","length","slice","replace","currentItem","canGoBack","isOpen","snapToIndex","backHandlerSubscription","addEventListener","remove","AnimatedView","View","enteringAnimation","duration","exitingAnimation","renderBackdrop","props","disappearsOnIndex","style","backgroundColor","appearsOnIndex","pressBehavior","Provider","value","ref","index","snapPoints","enableDynamicSizing","undefined","enablePanDownToClose","android_keyboardInputMode","enableBlurKeyboardOnGesture","keyboardBlurBehavior","keyboardBehavior","onClose","backdropComponent","topInset","handleIndicatorStyle","styles","sheetContainer","entering","exiting","animatedView","component","create","flex"],"sourceRoot":"..\\..\\..\\src","sources":["contexts/BottomSheetStackProvider.tsx"],"mappings":";;AAAA,OAAOA,WAAW,IAChBC,mBAAmB,QAEd,sBAAsB;AAC7B,OAAOC,KAAK,IAEVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,WAAW,EAAEC,UAAU,QAAQ,cAAc;AACtD,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AACnE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SACEC,uBAAuB,QAElB,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,OAAO,MAAMC,wBAA2D,GAAGA,CAAC;EAC1EC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGf,QAAQ,CAAyB,EAAE,CAAC;EAC9D,MAAMgB,QAAQ,GAAGjB,MAAM,CAAc,IAAI,CAAC;EAC1C,MAAM;IAAEkB;EAAI,CAAC,GAAGX,iBAAiB,CAAC,CAAC;EAEnC,MAAMY,IAAI,GAAGtB,WAAW,CAAEuB,IAA0B,IAAK;IACvDJ,QAAQ,CAAEK,IAAI,IAAK,CAAC,GAAGA,IAAI,EAAED,IAAI,CAAC,CAAC;EACrC,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME,KAAK,GAAGzB,WAAW,CAAC,MAAM;IAC9BoB,QAAQ,CAACM,OAAO,EAAEC,KAAK,CAAC,CAAC;IACzBR,QAAQ,CAAC,EAAE,CAAC;EACd,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMS,GAAG,GAAG5B,WAAW,CAAC,MAAM;IAC5B,IAAIkB,KAAK,CAACW,MAAM,IAAI,CAAC,EAAE;MACrBJ,KAAK,CAAC,CAAC;MACP;IACF;IACAN,QAAQ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;QAC5B6B,OAAO,EAAE3B,gBAAiB;QAC1BI,KAAK,EAAEoB,MAAM,CAACI,YAAa;QAAAtD,QAAA,EAE1Be,WAAW,CAACwC;MAAS,GALjBtD,KAAK,CAACW,MAMC;IACf,CACU,CAAC;EAAA,CACkB,CAAC;AAEvC,CAAC;AAED,MAAMsC,MAAM,GAAG7D,UAAU,CAACmE,MAAM,CAAC;EAC/BL,cAAc,EAAE;IACd;IACA;IACA;EAAA,CACD;EACDG,YAAY,EAAE;IACZG,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["contexts/index.ts"],"mappings":";;AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"..\\..\\..\\src","sources":["contexts/index.ts"],"mappings":";;AAAA,cAAc,8BAA2B;AACzC,cAAc,+BAA4B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["iso2ToFlagEmoji","countryCode","toUpperCase","split","map","ch","String","fromCodePoint","charCodeAt","join"],"sourceRoot":"..\\..\\..\\src","sources":["utils/flags.ts"],"mappings":";;AAAA,OAAO,SAASA,eAAeA,CAACC,WAAmB,EAAU;EAC3D,OAAOA,WAAW,CACfC,WAAW,CAAC,CAAC,CACbC,KAAK,CAAC,EAAE,CAAC,CACTC,GAAG,CAACC,EAAE,IAAIC,MAAM,CAACC,aAAa,CAACF,EAAE,CAACG,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,CAC1DC,IAAI,CAAC,EAAE,CAAC;AACb","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAqDxC,QAAA,MAAM,GAAG,yBA4ER,CAAC;AAUF,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TextInput, StyleProp, TextStyle } from "react-native";
|
|
3
|
+
import { CustomInputProps } from "./Input";
|
|
4
|
+
export type Country = {
|
|
5
|
+
code: string;
|
|
6
|
+
iso2: string;
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
export interface PhoneInputProps extends Omit<CustomInputProps, "leftIcon" | "rightIcon" | "onRightIconPress" | "keyboardType" | "style" | "placeholderTextColor"> {
|
|
10
|
+
value: string;
|
|
11
|
+
onChangeText: (text: string) => void;
|
|
12
|
+
selectedCountry?: Country;
|
|
13
|
+
onSelectCountry?: (c: Country) => void;
|
|
14
|
+
countries?: Country[];
|
|
15
|
+
countryNameStyle?: StyleProp<TextStyle>;
|
|
16
|
+
countryCodeStyle?: StyleProp<TextStyle>;
|
|
17
|
+
listTitleStyle?: StyleProp<TextStyle>;
|
|
18
|
+
listTitle?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const PhoneInput: React.ForwardRefExoticComponent<PhoneInputProps & React.RefAttributes<TextInput>>;
|
|
21
|
+
export default PhoneInput;
|
|
22
|
+
//# sourceMappingURL=PhoneInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PhoneInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/PhoneInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqD,MAAM,OAAO,CAAC;AAC1E,OAAO,EACL,SAAS,EAOT,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAoB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AASxD,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,eACf,SAAQ,IAAI,CACV,gBAAgB,EACd,UAAU,GACV,WAAW,GACX,kBAAkB,GAClB,cAAc,GACd,OAAO,GACP,sBAAsB,CACzB;IACD,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;IAGtB,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAEtC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAQD,QAAA,MAAM,UAAU,mFAiHf,CAAC;AA2CF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAC,MAAM,SAAS,CAAC;AAC1C,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAC,MAAM,SAAS,CAAC;AAC1C,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAC,MAAM,cAAc,CAAC;AACpD,cAAc,cAAc,CAAC"}
|