@hitesh0009/react-native-basic-form 1.2.2 → 1.2.3
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 +10 -4
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/Form.tsx +18 -7
- package/src/types.ts +1 -0
package/dist/Form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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, imageContainerStyle, touchableOpacityProp, inputTextContainerStyle, inputTextGroupContainerStyle, ButtonContainerStyle, buttonGroupContainerStyle, buttonGroupStyle, inputButtonGroupContainerStyle, inputButtonGroupInputStyle, inputButtonGroupButtonStyle, inputButtonGroupButtonTextStyle }) => {
|
|
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, touchableOpacityProp, inputTextContainerStyle, inputTextGroupContainerStyle, ButtonContainerStyle, buttonGroupContainerStyle, buttonGroupStyle, buttonGroupTextStyle, inputButtonGroupContainerStyle, inputButtonGroupInputStyle, inputButtonGroupButtonStyle, inputButtonGroupButtonTextStyle, }) => {
|
|
3
3
|
return (<View style={[{ gap: 20 }, containerStyle]}>
|
|
4
4
|
{(headerIcon || headerText) && (<View style={[{ flexDirection: "row", gap: 10 }, headerContainerStyle]}>
|
|
5
5
|
{headerIcon && (<View style={imageContainerStyle}>
|
|
@@ -35,7 +35,7 @@ export const Form = ({ data, gap_bwt_keyValue = 10, gap_bwt_keys = 12, lableStyl
|
|
|
35
35
|
buttonGroupContainerStyle,
|
|
36
36
|
]}>
|
|
37
37
|
{item.buttonGroup.map((btn, index) => (<TouchableOpacity key={index} onPress={btn.onPress} style={[styles.button_container, buttonGroupStyle]}>
|
|
38
|
-
<Text style={[styles.button_text,
|
|
38
|
+
<Text style={[styles.button_text, buttonGroupTextStyle]}>
|
|
39
39
|
{btn.label}
|
|
40
40
|
</Text>
|
|
41
41
|
</TouchableOpacity>))}
|
|
@@ -58,8 +58,14 @@ export const Form = ({ data, gap_bwt_keyValue = 10, gap_bwt_keys = 12, lableStyl
|
|
|
58
58
|
{item.inputButtonGroup.button.header}
|
|
59
59
|
</Text>
|
|
60
60
|
|
|
61
|
-
<TouchableOpacity onPress={item.inputButtonGroup.button.onPress} style={[
|
|
62
|
-
|
|
61
|
+
<TouchableOpacity onPress={item.inputButtonGroup.button.onPress} style={[
|
|
62
|
+
styles.button_container,
|
|
63
|
+
inputButtonGroupButtonStyle,
|
|
64
|
+
]}>
|
|
65
|
+
<Text style={[
|
|
66
|
+
styles.button_text,
|
|
67
|
+
inputButtonGroupButtonTextStyle,
|
|
68
|
+
]}>
|
|
63
69
|
{item.inputButtonGroup.button.label}
|
|
64
70
|
</Text>
|
|
65
71
|
</TouchableOpacity>
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/Form.tsx
CHANGED
|
@@ -39,11 +39,12 @@ export const Form: React.FC<FormProps> = ({
|
|
|
39
39
|
|
|
40
40
|
buttonGroupContainerStyle,
|
|
41
41
|
buttonGroupStyle,
|
|
42
|
+
buttonGroupTextStyle,
|
|
42
43
|
|
|
43
44
|
inputButtonGroupContainerStyle,
|
|
44
45
|
inputButtonGroupInputStyle,
|
|
45
46
|
inputButtonGroupButtonStyle,
|
|
46
|
-
inputButtonGroupButtonTextStyle
|
|
47
|
+
inputButtonGroupButtonTextStyle,
|
|
47
48
|
}) => {
|
|
48
49
|
return (
|
|
49
50
|
<View style={[{ gap: 20 }, containerStyle]}>
|
|
@@ -130,7 +131,7 @@ export const Form: React.FC<FormProps> = ({
|
|
|
130
131
|
onPress={btn.onPress}
|
|
131
132
|
style={[styles.button_container, buttonGroupStyle]}
|
|
132
133
|
>
|
|
133
|
-
<Text style={[styles.button_text,
|
|
134
|
+
<Text style={[styles.button_text, buttonGroupTextStyle]}>
|
|
134
135
|
{btn.label}
|
|
135
136
|
</Text>
|
|
136
137
|
</TouchableOpacity>
|
|
@@ -145,12 +146,14 @@ export const Form: React.FC<FormProps> = ({
|
|
|
145
146
|
inputButtonGroupContainerStyle,
|
|
146
147
|
]}
|
|
147
148
|
>
|
|
148
|
-
<View
|
|
149
|
+
<View
|
|
150
|
+
style={[inputTextContainerStyle, { gap: gap_bwt_keyValue }]}
|
|
151
|
+
>
|
|
149
152
|
<Text style={[styles.lable, lableStyle]}>
|
|
150
153
|
{item.inputButtonGroup.input.header}
|
|
151
154
|
</Text>
|
|
152
155
|
|
|
153
|
-
<TextInput
|
|
156
|
+
<TextInput
|
|
154
157
|
{...textInputProps}
|
|
155
158
|
style={[styles.inputtext, inputButtonGroupInputStyle]}
|
|
156
159
|
placeholder={item.inputButtonGroup.input.placeholder}
|
|
@@ -160,16 +163,24 @@ export const Form: React.FC<FormProps> = ({
|
|
|
160
163
|
/>
|
|
161
164
|
</View>
|
|
162
165
|
|
|
163
|
-
<View style={{gap:gap_bwt_keyValue}}>
|
|
166
|
+
<View style={{ gap: gap_bwt_keyValue }}>
|
|
164
167
|
<Text style={[styles.lable, lableStyle]}>
|
|
165
168
|
{item.inputButtonGroup.button.header}
|
|
166
169
|
</Text>
|
|
167
170
|
|
|
168
171
|
<TouchableOpacity
|
|
169
172
|
onPress={item.inputButtonGroup.button.onPress}
|
|
170
|
-
style={[
|
|
173
|
+
style={[
|
|
174
|
+
styles.button_container,
|
|
175
|
+
inputButtonGroupButtonStyle,
|
|
176
|
+
]}
|
|
171
177
|
>
|
|
172
|
-
<Text
|
|
178
|
+
<Text
|
|
179
|
+
style={[
|
|
180
|
+
styles.button_text,
|
|
181
|
+
inputButtonGroupButtonTextStyle,
|
|
182
|
+
]}
|
|
183
|
+
>
|
|
173
184
|
{item.inputButtonGroup.button.label}
|
|
174
185
|
</Text>
|
|
175
186
|
</TouchableOpacity>
|