@hitesh0009/react-native-basic-form 1.1.5 → 1.1.7

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/Form.js CHANGED
@@ -1,12 +1,14 @@
1
1
  import { FlatList, Image, StyleSheet, Text, TextInput, TouchableOpacity, View, } from "react-native";
2
- export const Form = ({ data, gap_bwt_keyValue = 10, gap_bwt_keys = 12, lableStyle, inputTextStyle, buttonContainerStyle, buttonTextStyle, headerIcon, headerIconStyle, headerTextStyle, imageProps, flatlistProps, textInputProps, textProp, headerText, headerContainerStyle, containerStyle, }) => {
2
+ export const Form = ({ data, gap_bwt_keyValue = 10, gap_bwt_keys = 12, lableStyle, inputTextStyle, buttonContainerStyle, buttonTextStyle, headerIcon, headerIconStyle, headerTextStyle, imageProps, flatlistProps, textInputProps, textProp, headerText, headerContainerStyle, containerStyle, imageContainerStyle }) => {
3
3
  return (<View style={[{ gap: 20 }, containerStyle]}>
4
- <View style={[{ flexDirection: "row", gap: 10 }, headerContainerStyle]}>
5
- {headerIcon && (<Image source={headerIcon} style={[styles.headericon, headerIconStyle]} {...imageProps}/>)}
6
- {headerText && (<Text style={[styles.headertext, headerTextStyle]} {...textProp}>
7
- {headerText}
8
- </Text>)}
9
- </View>
4
+ {(headerIcon || headerText) && (<View style={[{ flexDirection: "row", gap: 10 }, headerContainerStyle]}>
5
+ {headerIcon && (<View style={imageContainerStyle}>
6
+ <Image source={headerIcon} style={[styles.headericon, headerIconStyle]} {...imageProps}/>
7
+ </View>)}
8
+ {headerText && (<Text style={[styles.headertext, headerTextStyle]} {...textProp}>
9
+ {headerText}
10
+ </Text>)}
11
+ </View>)}
10
12
 
11
13
  <FlatList {...flatlistProps} data={data} keyExtractor={(item) => item.id} ItemSeparatorComponent={() => <View style={{ height: gap_bwt_keys }}/>} renderItem={({ item }) => (<View style={{ gap: gap_bwt_keyValue }}>
12
14
  {item.label && (<Text style={[styles.lable, lableStyle]}>{item.label}</Text>)}
package/dist/types.d.ts CHANGED
@@ -36,4 +36,5 @@ export type FormProps = {
36
36
  headerContainerStyle?: ViewStyle;
37
37
  containerStyle?: ViewStyle;
38
38
  textInputProps?: TextInputProps;
39
+ imageContainerStyle?: ViewStyle;
39
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitesh0009/react-native-basic-form",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "A lightweight, data-driven form renderer for React Native with fully controlled inputs and flexible styling.",
5
5
  "keywords": [
6
6
  "react-native",
package/src/Form.tsx CHANGED
@@ -27,23 +27,28 @@ export const Form: React.FC<FormProps> = ({
27
27
  headerText,
28
28
  headerContainerStyle,
29
29
  containerStyle,
30
+ imageContainerStyle
30
31
  }) => {
31
32
  return (
32
- <View style={[{gap:20},containerStyle]}>
33
- <View style={[{ flexDirection: "row",gap:10 }, headerContainerStyle]}>
34
- {headerIcon && (
35
- <Image
36
- source={headerIcon}
37
- style={[styles.headericon, headerIconStyle]}
38
- {...imageProps}
39
- />
40
- )}
41
- {headerText && (
42
- <Text style={[styles.headertext, headerTextStyle]} {...textProp}>
43
- {headerText}
44
- </Text>
45
- )}
46
- </View>
33
+ <View style={[{ gap: 20 }, containerStyle]}>
34
+ {(headerIcon || headerText) && (
35
+ <View style={[{ flexDirection: "row", gap: 10 }, headerContainerStyle]}>
36
+ {headerIcon && (
37
+ <View style={imageContainerStyle}>
38
+ <Image
39
+ source={headerIcon}
40
+ style={[styles.headericon, headerIconStyle]}
41
+ {...imageProps}
42
+ />
43
+ </View>
44
+ )}
45
+ {headerText && (
46
+ <Text style={[styles.headertext, headerTextStyle]} {...textProp}>
47
+ {headerText}
48
+ </Text>
49
+ )}
50
+ </View>
51
+ )}
47
52
 
48
53
  <FlatList<FormItem>
49
54
  {...flatlistProps}
package/src/types.ts CHANGED
@@ -54,4 +54,5 @@ export type FormProps = {
54
54
  headerContainerStyle?: ViewStyle;
55
55
  containerStyle?: ViewStyle;
56
56
  textInputProps?: TextInputProps
57
+ imageContainerStyle?:ViewStyle
57
58
  };