@hitesh0009/react-native-basic-form 1.2.0 → 1.2.2
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 +15 -7
- package/dist/types.d.ts +19 -2
- package/package.json +1 -1
- package/src/Form.tsx +19 -8
- package/src/types.ts +25 -5
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 }) => {
|
|
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 }) => {
|
|
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}>
|
|
@@ -45,17 +45,25 @@ export const Form = ({ data, gap_bwt_keyValue = 10, gap_bwt_keys = 12, lableStyl
|
|
|
45
45
|
{ flexDirection: "row", gap: 10 },
|
|
46
46
|
inputButtonGroupContainerStyle,
|
|
47
47
|
]}>
|
|
48
|
-
<View style={inputTextContainerStyle}>
|
|
49
|
-
<
|
|
48
|
+
<View style={[inputTextContainerStyle, { gap: gap_bwt_keyValue }]}>
|
|
49
|
+
<Text style={[styles.lable, lableStyle]}>
|
|
50
|
+
{item.inputButtonGroup.input.header}
|
|
51
|
+
</Text>
|
|
52
|
+
|
|
53
|
+
<TextInput {...textInputProps} style={[styles.inputtext, inputButtonGroupInputStyle]} placeholder={item.inputButtonGroup.input.placeholder} value={item.inputButtonGroup.input.value} onChangeText={item.inputButtonGroup.input.onChangeText} keyboardType={item.inputButtonGroup.input.keyboardType}/>
|
|
50
54
|
</View>
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
56
|
+
<View style={{ gap: gap_bwt_keyValue }}>
|
|
57
|
+
<Text style={[styles.lable, lableStyle]}>
|
|
58
|
+
{item.inputButtonGroup.button.header}
|
|
59
|
+
</Text>
|
|
60
|
+
|
|
61
|
+
<TouchableOpacity onPress={item.inputButtonGroup.button.onPress} style={[styles.button_container, inputButtonGroupButtonStyle]}>
|
|
62
|
+
<Text style={[styles.button_text, inputButtonGroupButtonTextStyle]}>
|
|
55
63
|
{item.inputButtonGroup.button.label}
|
|
56
64
|
</Text>
|
|
57
65
|
</TouchableOpacity>
|
|
58
|
-
|
|
66
|
+
</View>
|
|
59
67
|
</View>)}
|
|
60
68
|
</View>)}/>
|
|
61
69
|
</View>);
|
package/dist/types.d.ts
CHANGED
|
@@ -11,9 +11,23 @@ export type FormButton = {
|
|
|
11
11
|
label: string;
|
|
12
12
|
onPress: () => void;
|
|
13
13
|
};
|
|
14
|
+
export type ForminputButtonGroupInput = {
|
|
15
|
+
header: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
value: string;
|
|
18
|
+
onChangeText: TextInputProps["onChangeText"];
|
|
19
|
+
multiline?: TextInputProps["multiline"];
|
|
20
|
+
textAlignVertical?: TextInputProps["textAlignVertical"];
|
|
21
|
+
keyboardType?: TextInputProps["keyboardType"];
|
|
22
|
+
};
|
|
23
|
+
export type ForminputButtonGroupButton = {
|
|
24
|
+
header: string;
|
|
25
|
+
label: string;
|
|
26
|
+
onPress: () => void;
|
|
27
|
+
};
|
|
14
28
|
export type ForminputButtonGroup = {
|
|
15
|
-
input:
|
|
16
|
-
button:
|
|
29
|
+
input: ForminputButtonGroupInput;
|
|
30
|
+
button: ForminputButtonGroupButton;
|
|
17
31
|
};
|
|
18
32
|
export type FormItem = {
|
|
19
33
|
id: string;
|
|
@@ -51,4 +65,7 @@ export type FormProps = {
|
|
|
51
65
|
buttonGroupStyle?: ViewStyle;
|
|
52
66
|
inputTextGroupContainerStyle?: ViewStyle;
|
|
53
67
|
inputButtonGroupContainerStyle?: ViewStyle;
|
|
68
|
+
inputButtonGroupInputStyle?: ViewStyle;
|
|
69
|
+
inputButtonGroupButtonStyle?: ViewStyle;
|
|
70
|
+
inputButtonGroupButtonTextStyle?: ViewStyle;
|
|
54
71
|
};
|
package/package.json
CHANGED
package/src/Form.tsx
CHANGED
|
@@ -40,7 +40,10 @@ export const Form: React.FC<FormProps> = ({
|
|
|
40
40
|
buttonGroupContainerStyle,
|
|
41
41
|
buttonGroupStyle,
|
|
42
42
|
|
|
43
|
-
inputButtonGroupContainerStyle
|
|
43
|
+
inputButtonGroupContainerStyle,
|
|
44
|
+
inputButtonGroupInputStyle,
|
|
45
|
+
inputButtonGroupButtonStyle,
|
|
46
|
+
inputButtonGroupButtonTextStyle
|
|
44
47
|
}) => {
|
|
45
48
|
return (
|
|
46
49
|
<View style={[{ gap: 20 }, containerStyle]}>
|
|
@@ -142,10 +145,14 @@ export const Form: React.FC<FormProps> = ({
|
|
|
142
145
|
inputButtonGroupContainerStyle,
|
|
143
146
|
]}
|
|
144
147
|
>
|
|
145
|
-
<View style={inputTextContainerStyle}>
|
|
146
|
-
<
|
|
148
|
+
<View style={[inputTextContainerStyle,{gap:gap_bwt_keyValue}]}>
|
|
149
|
+
<Text style={[styles.lable, lableStyle]}>
|
|
150
|
+
{item.inputButtonGroup.input.header}
|
|
151
|
+
</Text>
|
|
152
|
+
|
|
153
|
+
<TextInput
|
|
147
154
|
{...textInputProps}
|
|
148
|
-
style={[styles.inputtext,
|
|
155
|
+
style={[styles.inputtext, inputButtonGroupInputStyle]}
|
|
149
156
|
placeholder={item.inputButtonGroup.input.placeholder}
|
|
150
157
|
value={item.inputButtonGroup.input.value}
|
|
151
158
|
onChangeText={item.inputButtonGroup.input.onChangeText}
|
|
@@ -153,16 +160,20 @@ export const Form: React.FC<FormProps> = ({
|
|
|
153
160
|
/>
|
|
154
161
|
</View>
|
|
155
162
|
|
|
156
|
-
|
|
163
|
+
<View style={{gap:gap_bwt_keyValue}}>
|
|
164
|
+
<Text style={[styles.lable, lableStyle]}>
|
|
165
|
+
{item.inputButtonGroup.button.header}
|
|
166
|
+
</Text>
|
|
167
|
+
|
|
157
168
|
<TouchableOpacity
|
|
158
169
|
onPress={item.inputButtonGroup.button.onPress}
|
|
159
|
-
style={[styles.button_container,
|
|
170
|
+
style={[styles.button_container, inputButtonGroupButtonStyle]}
|
|
160
171
|
>
|
|
161
|
-
<Text style={[styles.button_text,
|
|
172
|
+
<Text style={[styles.button_text, inputButtonGroupButtonTextStyle]}>
|
|
162
173
|
{item.inputButtonGroup.button.label}
|
|
163
174
|
</Text>
|
|
164
175
|
</TouchableOpacity>
|
|
165
|
-
|
|
176
|
+
</View>
|
|
166
177
|
</View>
|
|
167
178
|
)}
|
|
168
179
|
</View>
|
package/src/types.ts
CHANGED
|
@@ -24,9 +24,26 @@ export type FormButton = {
|
|
|
24
24
|
label: string;
|
|
25
25
|
onPress: () => void;
|
|
26
26
|
};
|
|
27
|
+
|
|
28
|
+
export type ForminputButtonGroupInput = {
|
|
29
|
+
header: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
value: string;
|
|
32
|
+
onChangeText: TextInputProps["onChangeText"];
|
|
33
|
+
multiline?: TextInputProps["multiline"];
|
|
34
|
+
textAlignVertical?: TextInputProps["textAlignVertical"];
|
|
35
|
+
keyboardType?: TextInputProps["keyboardType"];
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export type ForminputButtonGroupButton = {
|
|
39
|
+
header: string;
|
|
40
|
+
label: string;
|
|
41
|
+
onPress: () => void;
|
|
42
|
+
};
|
|
43
|
+
|
|
27
44
|
export type ForminputButtonGroup = {
|
|
28
|
-
input:
|
|
29
|
-
button:
|
|
45
|
+
input: ForminputButtonGroupInput;
|
|
46
|
+
button: ForminputButtonGroupButton;
|
|
30
47
|
};
|
|
31
48
|
|
|
32
49
|
export type FormItem = {
|
|
@@ -36,7 +53,7 @@ export type FormItem = {
|
|
|
36
53
|
button?: FormButton;
|
|
37
54
|
buttonGroup?: FormButton[];
|
|
38
55
|
inputTextGroup?: FormInput[];
|
|
39
|
-
inputButtonGroup?:ForminputButtonGroup
|
|
56
|
+
inputButtonGroup?: ForminputButtonGroup;
|
|
40
57
|
};
|
|
41
58
|
|
|
42
59
|
export type FormProps = {
|
|
@@ -69,6 +86,9 @@ export type FormProps = {
|
|
|
69
86
|
ButtonContainerStyle?: ViewStyle;
|
|
70
87
|
buttonGroupContainerStyle?: ViewStyle;
|
|
71
88
|
buttonGroupStyle?: ViewStyle;
|
|
72
|
-
inputTextGroupContainerStyle?:ViewStyle
|
|
73
|
-
inputButtonGroupContainerStyle?:ViewStyle
|
|
89
|
+
inputTextGroupContainerStyle?: ViewStyle;
|
|
90
|
+
inputButtonGroupContainerStyle?: ViewStyle;
|
|
91
|
+
inputButtonGroupInputStyle?:ViewStyle,
|
|
92
|
+
inputButtonGroupButtonStyle?:ViewStyle,
|
|
93
|
+
inputButtonGroupButtonTextStyle?:ViewStyle
|
|
74
94
|
};
|