@hoddy-ui/next 2.0.35 → 2.0.37
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.d.mts +14 -6
- package/dist/index.d.ts +14 -6
- package/dist/index.js +206 -189
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -189
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, TextInput } from 'react-native';
|
|
3
3
|
import * as index from 'index';
|
|
4
4
|
|
|
5
5
|
type ThemeTypes = "dark" | "light";
|
|
@@ -324,14 +324,22 @@ type predictionType = {
|
|
|
324
324
|
id: string;
|
|
325
325
|
description: string;
|
|
326
326
|
};
|
|
327
|
-
declare const getPredictionsFromCoords: (coords:
|
|
327
|
+
declare const getPredictionsFromCoords: (coords: {
|
|
328
|
+
latitude: number;
|
|
329
|
+
longitude: number;
|
|
330
|
+
}) => Promise<{
|
|
328
331
|
description: any;
|
|
329
332
|
id: any;
|
|
330
333
|
latLng: {
|
|
331
|
-
lst:
|
|
332
|
-
lng:
|
|
334
|
+
lst: number;
|
|
335
|
+
lng: number;
|
|
333
336
|
};
|
|
334
337
|
}[]>;
|
|
338
|
+
declare const getPredictionsFromQuery: (query: string, country: string) => Promise<{
|
|
339
|
+
description: any;
|
|
340
|
+
id: any;
|
|
341
|
+
}[]>;
|
|
342
|
+
declare const getLocationFromPlaceId: (place_id: string) => Promise<any>;
|
|
335
343
|
declare const Locator: React.FC<LocatorProps>;
|
|
336
344
|
|
|
337
345
|
declare const Popup: React.FC<PopupProps>;
|
|
@@ -345,7 +353,7 @@ declare const SelectMenu: React.FC<SelectMenuProps>;
|
|
|
345
353
|
declare const Spinner: React.FC<SpinnerProps>;
|
|
346
354
|
|
|
347
355
|
declare const TextField: React.FC<TextFieldProps>;
|
|
348
|
-
declare const TextField2: React.
|
|
356
|
+
declare const TextField2: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextInput>>;
|
|
349
357
|
|
|
350
358
|
declare const Typography: React.FC<TypographyProps>;
|
|
351
359
|
|
|
@@ -611,4 +619,4 @@ declare const HoddyUI: {
|
|
|
611
619
|
initialize: typeof initialize;
|
|
612
620
|
};
|
|
613
621
|
|
|
614
|
-
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimatorProps, Avatar, type AvatarProps, Button, type ButtonProps, CheckBox, type CheckboxProps, Divider, type DividerProps, type FlashMessageProps, FormWrapper, type FormWrapperProps, Grid, GridItem, type GridItemProps, type GridProps, IconButton, type IconButtonProps, LinkButton, type LinkButtonProps, type ListItemProps, type ListItemTextProps, type ListProps, Locator, type LocatorInputProps, type LocatorProps, OTPInput, type OTPInputProps, Popup, type PopupProps, RatingInput, type RatingInputProps, RatingStars, type RatingStarsProps, SafeAreaView, type SafeAreaViewProps, SelectMenu, type SelectMenuProps, Spinner, type SpinnerProps, TextField, TextField2, type TextFieldProps, type ThemeActionTypes, type ThemeContext, type ThemeModes, type ThemeProviderProps, type ThemeState, type ThemeTypes, Typography, type TypographyProps, UIThemeContext, UIThemeProvider, type colorTypes, HoddyUI as default, type extraColorTypes, getPredictionsFromCoords, type locatorLocation, type predictionType, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
|
622
|
+
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimatorProps, Avatar, type AvatarProps, Button, type ButtonProps, CheckBox, type CheckboxProps, Divider, type DividerProps, type FlashMessageProps, FormWrapper, type FormWrapperProps, Grid, GridItem, type GridItemProps, type GridProps, IconButton, type IconButtonProps, LinkButton, type LinkButtonProps, type ListItemProps, type ListItemTextProps, type ListProps, Locator, type LocatorInputProps, type LocatorProps, OTPInput, type OTPInputProps, Popup, type PopupProps, RatingInput, type RatingInputProps, RatingStars, type RatingStarsProps, SafeAreaView, type SafeAreaViewProps, SelectMenu, type SelectMenuProps, Spinner, type SpinnerProps, TextField, TextField2, type TextFieldProps, type ThemeActionTypes, type ThemeContext, type ThemeModes, type ThemeProviderProps, type ThemeState, type ThemeTypes, Typography, type TypographyProps, UIThemeContext, UIThemeProvider, type colorTypes, HoddyUI as default, type extraColorTypes, getLocationFromPlaceId, getPredictionsFromCoords, getPredictionsFromQuery, type locatorLocation, type predictionType, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, TextInput } from 'react-native';
|
|
3
3
|
import * as index from 'index';
|
|
4
4
|
|
|
5
5
|
type ThemeTypes = "dark" | "light";
|
|
@@ -324,14 +324,22 @@ type predictionType = {
|
|
|
324
324
|
id: string;
|
|
325
325
|
description: string;
|
|
326
326
|
};
|
|
327
|
-
declare const getPredictionsFromCoords: (coords:
|
|
327
|
+
declare const getPredictionsFromCoords: (coords: {
|
|
328
|
+
latitude: number;
|
|
329
|
+
longitude: number;
|
|
330
|
+
}) => Promise<{
|
|
328
331
|
description: any;
|
|
329
332
|
id: any;
|
|
330
333
|
latLng: {
|
|
331
|
-
lst:
|
|
332
|
-
lng:
|
|
334
|
+
lst: number;
|
|
335
|
+
lng: number;
|
|
333
336
|
};
|
|
334
337
|
}[]>;
|
|
338
|
+
declare const getPredictionsFromQuery: (query: string, country: string) => Promise<{
|
|
339
|
+
description: any;
|
|
340
|
+
id: any;
|
|
341
|
+
}[]>;
|
|
342
|
+
declare const getLocationFromPlaceId: (place_id: string) => Promise<any>;
|
|
335
343
|
declare const Locator: React.FC<LocatorProps>;
|
|
336
344
|
|
|
337
345
|
declare const Popup: React.FC<PopupProps>;
|
|
@@ -345,7 +353,7 @@ declare const SelectMenu: React.FC<SelectMenuProps>;
|
|
|
345
353
|
declare const Spinner: React.FC<SpinnerProps>;
|
|
346
354
|
|
|
347
355
|
declare const TextField: React.FC<TextFieldProps>;
|
|
348
|
-
declare const TextField2: React.
|
|
356
|
+
declare const TextField2: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextInput>>;
|
|
349
357
|
|
|
350
358
|
declare const Typography: React.FC<TypographyProps>;
|
|
351
359
|
|
|
@@ -611,4 +619,4 @@ declare const HoddyUI: {
|
|
|
611
619
|
initialize: typeof initialize;
|
|
612
620
|
};
|
|
613
621
|
|
|
614
|
-
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimatorProps, Avatar, type AvatarProps, Button, type ButtonProps, CheckBox, type CheckboxProps, Divider, type DividerProps, type FlashMessageProps, FormWrapper, type FormWrapperProps, Grid, GridItem, type GridItemProps, type GridProps, IconButton, type IconButtonProps, LinkButton, type LinkButtonProps, type ListItemProps, type ListItemTextProps, type ListProps, Locator, type LocatorInputProps, type LocatorProps, OTPInput, type OTPInputProps, Popup, type PopupProps, RatingInput, type RatingInputProps, RatingStars, type RatingStarsProps, SafeAreaView, type SafeAreaViewProps, SelectMenu, type SelectMenuProps, Spinner, type SpinnerProps, TextField, TextField2, type TextFieldProps, type ThemeActionTypes, type ThemeContext, type ThemeModes, type ThemeProviderProps, type ThemeState, type ThemeTypes, Typography, type TypographyProps, UIThemeContext, UIThemeProvider, type colorTypes, HoddyUI as default, type extraColorTypes, getPredictionsFromCoords, type locatorLocation, type predictionType, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
|
622
|
+
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimatorProps, Avatar, type AvatarProps, Button, type ButtonProps, CheckBox, type CheckboxProps, Divider, type DividerProps, type FlashMessageProps, FormWrapper, type FormWrapperProps, Grid, GridItem, type GridItemProps, type GridProps, IconButton, type IconButtonProps, LinkButton, type LinkButtonProps, type ListItemProps, type ListItemTextProps, type ListProps, Locator, type LocatorInputProps, type LocatorProps, OTPInput, type OTPInputProps, Popup, type PopupProps, RatingInput, type RatingInputProps, RatingStars, type RatingStarsProps, SafeAreaView, type SafeAreaViewProps, SelectMenu, type SelectMenuProps, Spinner, type SpinnerProps, TextField, TextField2, type TextFieldProps, type ThemeActionTypes, type ThemeContext, type ThemeModes, type ThemeProviderProps, type ThemeState, type ThemeTypes, Typography, type TypographyProps, UIThemeContext, UIThemeProvider, type colorTypes, HoddyUI as default, type extraColorTypes, getLocationFromPlaceId, getPredictionsFromCoords, getPredictionsFromQuery, type locatorLocation, type predictionType, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -55,7 +55,9 @@ __export(next_exports, {
|
|
|
55
55
|
UIThemeContext: () => UIThemeContext,
|
|
56
56
|
UIThemeProvider: () => UIThemeProvider,
|
|
57
57
|
default: () => next_default,
|
|
58
|
+
getLocationFromPlaceId: () => getLocationFromPlaceId,
|
|
58
59
|
getPredictionsFromCoords: () => getPredictionsFromCoords,
|
|
60
|
+
getPredictionsFromQuery: () => getPredictionsFromQuery,
|
|
59
61
|
showFlashMessage: () => showFlashMessage,
|
|
60
62
|
useColors: () => useColors,
|
|
61
63
|
useNavScreenOptions: () => useNavScreenOptions,
|
|
@@ -1571,191 +1573,194 @@ var TextField = ({
|
|
|
1571
1573
|
}
|
|
1572
1574
|
));
|
|
1573
1575
|
};
|
|
1574
|
-
var TextField2 = (
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
onFocus = () => {
|
|
1585
|
-
},
|
|
1586
|
-
onBlur = () => {
|
|
1587
|
-
},
|
|
1588
|
-
error,
|
|
1589
|
-
start,
|
|
1590
|
-
rounded,
|
|
1591
|
-
disabled = false,
|
|
1592
|
-
style = {},
|
|
1593
|
-
inputStyles = {},
|
|
1594
|
-
gutterBottom = 8,
|
|
1595
|
-
placeholder,
|
|
1596
|
-
end,
|
|
1597
|
-
options,
|
|
1598
|
-
...props
|
|
1599
|
-
}) => {
|
|
1600
|
-
const colors2 = useColors();
|
|
1601
|
-
const [focused, _setFocused] = (0, import_react16.useState)(false);
|
|
1602
|
-
const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
|
|
1603
|
-
const height = (0, import_react_native_size_matters14.moderateScale)(
|
|
1604
|
-
props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1605
|
-
);
|
|
1606
|
-
const setFocused = (value2) => {
|
|
1607
|
-
_setFocused(value2);
|
|
1608
|
-
};
|
|
1609
|
-
const styles2 = import_react_native_size_matters14.ScaledSheet.create({
|
|
1610
|
-
root: {
|
|
1611
|
-
marginBottom: gutterBottom + "@vs",
|
|
1612
|
-
...style
|
|
1613
|
-
},
|
|
1614
|
-
container: {
|
|
1615
|
-
height,
|
|
1616
|
-
overflow: "hidden",
|
|
1617
|
-
flexDirection: "row",
|
|
1618
|
-
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[5],
|
|
1619
|
-
borderWidth: error ? 1 : focused ? 2 : 1,
|
|
1620
|
-
width: "100%",
|
|
1621
|
-
borderRadius: rounded ? 30 : 10,
|
|
1622
|
-
alignItems: "center",
|
|
1623
|
-
...inputStyles
|
|
1624
|
-
},
|
|
1625
|
-
input: {
|
|
1626
|
-
fontSize: "14@s",
|
|
1627
|
-
flex: 1,
|
|
1628
|
-
alignSelf: "stretch",
|
|
1629
|
-
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1630
|
-
paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1631
|
-
color: colors2.dark.main,
|
|
1632
|
-
zIndex: 10
|
|
1633
|
-
// backgroundColor: "#284",
|
|
1634
|
-
},
|
|
1635
|
-
inputText: {
|
|
1636
|
-
fontSize: "14@ms",
|
|
1637
|
-
color: colors2.dark.main,
|
|
1638
|
-
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
|
|
1639
|
-
},
|
|
1640
|
-
placeholder: {
|
|
1641
|
-
fontSize: "14@ms",
|
|
1642
|
-
color: colors2.textSecondary.main,
|
|
1643
|
-
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
|
|
1576
|
+
var TextField2 = import_react16.default.forwardRef(
|
|
1577
|
+
({
|
|
1578
|
+
label,
|
|
1579
|
+
keyboardType,
|
|
1580
|
+
color = "primary",
|
|
1581
|
+
value,
|
|
1582
|
+
type,
|
|
1583
|
+
helperText,
|
|
1584
|
+
onChangeText,
|
|
1585
|
+
onSubmitEditing = () => {
|
|
1644
1586
|
},
|
|
1645
|
-
|
|
1646
|
-
helperText: {
|
|
1647
|
-
paddingHorizontal: "15@s",
|
|
1648
|
-
color: focused ? colors2[color].dark : "#fffa",
|
|
1649
|
-
paddingTop: "4@ms"
|
|
1587
|
+
onFocus = () => {
|
|
1650
1588
|
},
|
|
1651
|
-
|
|
1652
|
-
paddingLeft: 10,
|
|
1653
|
-
paddingRight: 10,
|
|
1654
|
-
paddingTop: 5,
|
|
1655
|
-
flexDirection: "row",
|
|
1656
|
-
alignItems: "center"
|
|
1657
|
-
},
|
|
1658
|
-
errorText: {
|
|
1659
|
-
fontSize: 12,
|
|
1660
|
-
marginLeft: 10
|
|
1661
|
-
}
|
|
1662
|
-
});
|
|
1663
|
-
const formProps = type === "email" ? {
|
|
1664
|
-
textContentType: "emailAddress",
|
|
1665
|
-
keyboardType: "email-address",
|
|
1666
|
-
autoCapitalize: "none",
|
|
1667
|
-
autoCompleteType: "email"
|
|
1668
|
-
} : type === "number" ? {
|
|
1669
|
-
keyboardType: "numeric"
|
|
1670
|
-
} : type === "tel" ? {
|
|
1671
|
-
textContentType: "telephoneNumber",
|
|
1672
|
-
keyboardType: "phone-pad"
|
|
1673
|
-
} : type === "search" ? {
|
|
1674
|
-
keyboardType: "web-search",
|
|
1675
|
-
returnKeyType: "search",
|
|
1676
|
-
autoCapitalize: "none"
|
|
1677
|
-
} : type === "password" ? {
|
|
1678
|
-
secureTextEntry: !showPassword,
|
|
1679
|
-
autoCompleteType: "password",
|
|
1680
|
-
autoCapitalize: "none",
|
|
1681
|
-
textContentType: "password"
|
|
1682
|
-
} : {};
|
|
1683
|
-
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.root }, label && /* @__PURE__ */ import_react16.default.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ import_react16.default.createElement(
|
|
1684
|
-
import_react_native16.TouchableOpacity,
|
|
1685
|
-
{
|
|
1686
|
-
onPress: () => setFocused(true),
|
|
1687
|
-
style: styles2.container
|
|
1589
|
+
onBlur = () => {
|
|
1688
1590
|
},
|
|
1591
|
+
error,
|
|
1689
1592
|
start,
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1593
|
+
rounded,
|
|
1594
|
+
disabled = false,
|
|
1595
|
+
style = {},
|
|
1596
|
+
inputStyles = {},
|
|
1597
|
+
gutterBottom = 8,
|
|
1598
|
+
placeholder,
|
|
1599
|
+
end,
|
|
1600
|
+
options,
|
|
1601
|
+
...props
|
|
1602
|
+
}, ref) => {
|
|
1603
|
+
const colors2 = useColors();
|
|
1604
|
+
const [focused, _setFocused] = (0, import_react16.useState)(false);
|
|
1605
|
+
const [showPassword, setShowPassword] = (0, import_react16.useState)(false);
|
|
1606
|
+
const height = (0, import_react_native_size_matters14.moderateScale)(
|
|
1607
|
+
props.multiline ? 50 + (props.numberOfLines || 1) * 18 : 50
|
|
1608
|
+
);
|
|
1609
|
+
const setFocused = (value2) => {
|
|
1610
|
+
_setFocused(value2);
|
|
1611
|
+
};
|
|
1612
|
+
const styles2 = import_react_native_size_matters14.ScaledSheet.create({
|
|
1613
|
+
root: {
|
|
1614
|
+
marginBottom: gutterBottom + "@vs",
|
|
1615
|
+
...style
|
|
1616
|
+
},
|
|
1617
|
+
container: {
|
|
1618
|
+
height,
|
|
1619
|
+
overflow: "hidden",
|
|
1620
|
+
flexDirection: "row",
|
|
1621
|
+
borderColor: error ? colors2.error.main : focused ? colors2[color].main : colors2.white[5],
|
|
1622
|
+
borderWidth: error ? 1 : focused ? 2 : 1,
|
|
1623
|
+
width: "100%",
|
|
1624
|
+
borderRadius: rounded ? 30 : 10,
|
|
1625
|
+
alignItems: "center",
|
|
1626
|
+
...inputStyles
|
|
1627
|
+
},
|
|
1628
|
+
input: {
|
|
1629
|
+
fontSize: "14@s",
|
|
1630
|
+
flex: 1,
|
|
1631
|
+
alignSelf: "stretch",
|
|
1632
|
+
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1633
|
+
paddingRight: (0, import_react_native_size_matters14.moderateScale)(10),
|
|
1634
|
+
color: colors2.dark.main,
|
|
1635
|
+
zIndex: 10
|
|
1636
|
+
// backgroundColor: "#284",
|
|
1637
|
+
},
|
|
1638
|
+
inputText: {
|
|
1639
|
+
fontSize: "14@ms",
|
|
1640
|
+
color: colors2.dark.main,
|
|
1641
|
+
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
|
|
1642
|
+
},
|
|
1643
|
+
placeholder: {
|
|
1644
|
+
fontSize: "14@ms",
|
|
1645
|
+
color: colors2.textSecondary.main,
|
|
1646
|
+
paddingLeft: (0, import_react_native_size_matters14.moderateScale)(10)
|
|
1647
|
+
},
|
|
1648
|
+
label: {},
|
|
1649
|
+
helperText: {
|
|
1650
|
+
paddingHorizontal: "15@s",
|
|
1651
|
+
color: focused ? colors2[color].dark : "#fffa",
|
|
1652
|
+
paddingTop: "4@ms"
|
|
1653
|
+
},
|
|
1654
|
+
error: {
|
|
1655
|
+
paddingLeft: 10,
|
|
1656
|
+
paddingRight: 10,
|
|
1657
|
+
paddingTop: 5,
|
|
1658
|
+
flexDirection: "row",
|
|
1659
|
+
alignItems: "center"
|
|
1660
|
+
},
|
|
1661
|
+
errorText: {
|
|
1662
|
+
fontSize: 12,
|
|
1663
|
+
marginLeft: 10
|
|
1721
1664
|
}
|
|
1722
|
-
)
|
|
1723
|
-
|
|
1665
|
+
});
|
|
1666
|
+
const formProps = type === "email" ? {
|
|
1667
|
+
textContentType: "emailAddress",
|
|
1668
|
+
keyboardType: "email-address",
|
|
1669
|
+
autoCapitalize: "none",
|
|
1670
|
+
autoCompleteType: "email"
|
|
1671
|
+
} : type === "number" ? {
|
|
1672
|
+
keyboardType: "numeric"
|
|
1673
|
+
} : type === "tel" ? {
|
|
1674
|
+
textContentType: "telephoneNumber",
|
|
1675
|
+
keyboardType: "phone-pad"
|
|
1676
|
+
} : type === "search" ? {
|
|
1677
|
+
keyboardType: "web-search",
|
|
1678
|
+
returnKeyType: "search",
|
|
1679
|
+
autoCapitalize: "none"
|
|
1680
|
+
} : type === "password" ? {
|
|
1681
|
+
secureTextEntry: !showPassword,
|
|
1682
|
+
autoCompleteType: "password",
|
|
1683
|
+
autoCapitalize: "none",
|
|
1684
|
+
textContentType: "password"
|
|
1685
|
+
} : {};
|
|
1686
|
+
return /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.root }, label && /* @__PURE__ */ import_react16.default.createElement(Typography_default, { variant: "body1", color: "textSecondary", gutterBottom: 7 }, label), /* @__PURE__ */ import_react16.default.createElement(
|
|
1724
1687
|
import_react_native16.TouchableOpacity,
|
|
1725
1688
|
{
|
|
1726
|
-
|
|
1727
|
-
|
|
1689
|
+
onPress: () => setFocused(true),
|
|
1690
|
+
style: styles2.container
|
|
1728
1691
|
},
|
|
1729
|
-
|
|
1692
|
+
start,
|
|
1693
|
+
options ? /* @__PURE__ */ import_react16.default.createElement(import_react16.default.Fragment, null, value ? /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.inputText }, options.find((cur) => cur.value === value)?.label) : /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.placeholder }, placeholder), /* @__PURE__ */ import_react16.default.createElement(
|
|
1730
1694
|
import_vector_icons8.Ionicons,
|
|
1731
1695
|
{
|
|
1732
|
-
name:
|
|
1696
|
+
name: "chevron-down",
|
|
1733
1697
|
size: 24,
|
|
1734
|
-
|
|
1698
|
+
style: { marginLeft: "auto", marginRight: 15 },
|
|
1699
|
+
color: colors2.dark.light
|
|
1735
1700
|
}
|
|
1701
|
+
)) : /* @__PURE__ */ import_react16.default.createElement(
|
|
1702
|
+
import_react_native16.TextInput,
|
|
1703
|
+
{
|
|
1704
|
+
ref,
|
|
1705
|
+
onFocus: () => {
|
|
1706
|
+
onFocus();
|
|
1707
|
+
setFocused(true);
|
|
1708
|
+
},
|
|
1709
|
+
onBlur: () => {
|
|
1710
|
+
onBlur();
|
|
1711
|
+
setFocused(false);
|
|
1712
|
+
},
|
|
1713
|
+
value,
|
|
1714
|
+
onChangeText,
|
|
1715
|
+
key: showPassword ? "show" : "hide",
|
|
1716
|
+
keyboardType,
|
|
1717
|
+
placeholderTextColor: colors2.textSecondary.main,
|
|
1718
|
+
editable: !disabled,
|
|
1719
|
+
placeholder,
|
|
1720
|
+
selectTextOnFocus: !disabled,
|
|
1721
|
+
onSubmitEditing,
|
|
1722
|
+
...formProps,
|
|
1723
|
+
...props,
|
|
1724
|
+
style: styles2.input
|
|
1725
|
+
}
|
|
1726
|
+
),
|
|
1727
|
+
end ? /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: { marginRight: 20 } }, end) : type === "password" && /* @__PURE__ */ import_react16.default.createElement(
|
|
1728
|
+
import_react_native16.TouchableOpacity,
|
|
1729
|
+
{
|
|
1730
|
+
style: { marginRight: 20 },
|
|
1731
|
+
onPress: () => setShowPassword(!showPassword)
|
|
1732
|
+
},
|
|
1733
|
+
/* @__PURE__ */ import_react16.default.createElement(
|
|
1734
|
+
import_vector_icons8.Ionicons,
|
|
1735
|
+
{
|
|
1736
|
+
name: showPassword ? "eye-outline" : "eye-off-outline",
|
|
1737
|
+
size: 24,
|
|
1738
|
+
color: colors2.textSecondary.main
|
|
1739
|
+
}
|
|
1740
|
+
)
|
|
1736
1741
|
)
|
|
1737
|
-
)
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1742
|
+
), helperText && /* @__PURE__ */ import_react16.default.createElement(
|
|
1743
|
+
Typography_default,
|
|
1744
|
+
{
|
|
1745
|
+
color: "textSecondary",
|
|
1746
|
+
style: styles2.helperText,
|
|
1747
|
+
variant: "caption"
|
|
1748
|
+
},
|
|
1749
|
+
helperText
|
|
1750
|
+
), error && /* @__PURE__ */ import_react16.default.createElement(import_react_native16.View, { style: styles2.error }, /* @__PURE__ */ import_react16.default.createElement(import_vector_icons8.MaterialIcons, { name: "error", color: colors2.error.main, size: 16 }), /* @__PURE__ */ import_react16.default.createElement(Typography_default, { style: styles2.errorText, color: "error" }, error))), options && /* @__PURE__ */ import_react16.default.createElement(
|
|
1751
|
+
SelectMenu_default,
|
|
1752
|
+
{
|
|
1753
|
+
options,
|
|
1754
|
+
value,
|
|
1755
|
+
open: focused,
|
|
1756
|
+
onClose: () => setFocused(false),
|
|
1757
|
+
label,
|
|
1758
|
+
helperText,
|
|
1759
|
+
onChange: onChangeText
|
|
1760
|
+
}
|
|
1761
|
+
));
|
|
1762
|
+
}
|
|
1763
|
+
);
|
|
1759
1764
|
var TextField_default = TextField;
|
|
1760
1765
|
|
|
1761
1766
|
// ../src/Components/Locator.tsx
|
|
@@ -1783,6 +1788,27 @@ var getPredictionsFromCoords = async (coords) => {
|
|
|
1783
1788
|
}
|
|
1784
1789
|
return p;
|
|
1785
1790
|
};
|
|
1791
|
+
var getPredictionsFromQuery = async (query, country) => {
|
|
1792
|
+
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1793
|
+
const endpoint = `https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${query}&components=country:${country}&radius=20000&key=${GOOGLE_MAP_API_KEY}`;
|
|
1794
|
+
const res = await (await fetch(endpoint)).json();
|
|
1795
|
+
const p = [];
|
|
1796
|
+
for (let key in res.predictions) {
|
|
1797
|
+
const { description, place_id } = res.predictions[key];
|
|
1798
|
+
p.push({
|
|
1799
|
+
description,
|
|
1800
|
+
id: place_id
|
|
1801
|
+
});
|
|
1802
|
+
}
|
|
1803
|
+
return p;
|
|
1804
|
+
};
|
|
1805
|
+
var getLocationFromPlaceId = async (place_id) => {
|
|
1806
|
+
const { GOOGLE_MAP_API_KEY } = getConfig();
|
|
1807
|
+
const res = await (await fetch(
|
|
1808
|
+
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${place_id}&fields=formatted_address%2Cgeometry&key=${GOOGLE_MAP_API_KEY}`
|
|
1809
|
+
)).json();
|
|
1810
|
+
return res.result;
|
|
1811
|
+
};
|
|
1786
1812
|
var Locator = ({
|
|
1787
1813
|
variant = "contained",
|
|
1788
1814
|
onLocationSelected,
|
|
@@ -1822,17 +1848,8 @@ var Locator = ({
|
|
|
1822
1848
|
}
|
|
1823
1849
|
});
|
|
1824
1850
|
const search = async (query) => {
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1827
|
-
const p = [];
|
|
1828
|
-
for (let key in res.predictions) {
|
|
1829
|
-
const { description, place_id } = res.predictions[key];
|
|
1830
|
-
p.push({
|
|
1831
|
-
description,
|
|
1832
|
-
id: place_id
|
|
1833
|
-
});
|
|
1834
|
-
}
|
|
1835
|
-
setPrediction(p);
|
|
1851
|
+
const predictions = await getPredictionsFromQuery(query, country);
|
|
1852
|
+
setPrediction(predictions);
|
|
1836
1853
|
};
|
|
1837
1854
|
const locateMe = () => {
|
|
1838
1855
|
const getLoc = async () => {
|
|
@@ -1866,16 +1883,14 @@ var Locator = ({
|
|
|
1866
1883
|
};
|
|
1867
1884
|
const locationPressed = async (loc) => {
|
|
1868
1885
|
setValue(loc.description);
|
|
1869
|
-
const res = await (
|
|
1870
|
-
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${loc.id}&fields=formatted_address%2Cgeometry&key=${GOOGLE_MAP_API_KEY}`
|
|
1871
|
-
)).json();
|
|
1886
|
+
const res = await getLocationFromPlaceId(loc.id);
|
|
1872
1887
|
onLocationSelected(
|
|
1873
1888
|
{
|
|
1874
|
-
latitude: res.
|
|
1875
|
-
longitude: res.
|
|
1889
|
+
latitude: res.geometry.location.lat,
|
|
1890
|
+
longitude: res.geometry.location.lng,
|
|
1876
1891
|
description: loc.description
|
|
1877
1892
|
},
|
|
1878
|
-
res
|
|
1893
|
+
res?.formatted_address
|
|
1879
1894
|
);
|
|
1880
1895
|
setChanged(false);
|
|
1881
1896
|
setPrediction([]);
|
|
@@ -2140,7 +2155,9 @@ var next_default = HoddyUI;
|
|
|
2140
2155
|
Typography,
|
|
2141
2156
|
UIThemeContext,
|
|
2142
2157
|
UIThemeProvider,
|
|
2158
|
+
getLocationFromPlaceId,
|
|
2143
2159
|
getPredictionsFromCoords,
|
|
2160
|
+
getPredictionsFromQuery,
|
|
2144
2161
|
showFlashMessage,
|
|
2145
2162
|
useColors,
|
|
2146
2163
|
useNavScreenOptions,
|