vpt-sebraeds 0.0.88 → 0.0.89

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.
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { View, Pressable, StyleSheet } from 'react-native';
3
+ import { View, Pressable, StyleSheet, TextInput } from 'react-native';
4
4
  import Icon from '../Icon';
5
5
  import SEText from '../SEText';
6
6
  import { fontFamily } from '../utils/fontFamily';
@@ -50,6 +50,13 @@ const Item = ({
50
50
  valuePaddingVertical = 8,
51
51
  valueStyle,
52
52
  valueContainerStyle,
53
+ valueEditable = false,
54
+ onChangeValue,
55
+ valuePlaceholder = '',
56
+ valueKeyboardType = 'numeric',
57
+ valuePlaceholderTextColor = '#687499',
58
+ valueMaxLength,
59
+ valueTestID,
53
60
  // Test
54
61
  testID,
55
62
  }) => {
@@ -118,9 +125,25 @@ const Item = ({
118
125
  valueContainerStyle,
119
126
  ]}
120
127
  >
121
- <SEText type="ns-sm-body" style={[styles.value, valueStyle]}>
122
- {value}
123
- </SEText>
128
+ {valueEditable ? (
129
+ <TextInput
130
+ value={String(value ?? '')}
131
+ onChangeText={onChangeValue}
132
+ keyboardType={valueKeyboardType}
133
+ placeholder={valuePlaceholder}
134
+ placeholderTextColor={valuePlaceholderTextColor}
135
+ maxLength={valueMaxLength}
136
+ editable={!disabled}
137
+ textAlign="center"
138
+ underlineColorAndroid="transparent"
139
+ style={[styles.valueInput, valueStyle]}
140
+ testID={valueTestID}
141
+ />
142
+ ) : (
143
+ <SEText type="ns-sm-body" style={[styles.value, valueStyle]}>
144
+ {value}
145
+ </SEText>
146
+ )}
124
147
  </View>
125
148
  )}
126
149
  </Pressable>
@@ -160,6 +183,13 @@ Item.propTypes = {
160
183
  valuePaddingVertical: PropTypes.number,
161
184
  valueStyle: PropTypes.object,
162
185
  valueContainerStyle: PropTypes.object,
186
+ valueEditable: PropTypes.bool,
187
+ onChangeValue: PropTypes.func,
188
+ valuePlaceholder: PropTypes.string,
189
+ valueKeyboardType: PropTypes.string,
190
+ valuePlaceholderTextColor: PropTypes.string,
191
+ valueMaxLength: PropTypes.number,
192
+ valueTestID: PropTypes.string,
163
193
  testID: PropTypes.string,
164
194
  };
165
195
 
@@ -209,6 +239,17 @@ const styles = StyleSheet.create({
209
239
  color: '#1B244B',
210
240
  textAlign: 'center',
211
241
  },
242
+ valueInput: {
243
+ width: '100%',
244
+ height: '100%',
245
+ fontSize: 18,
246
+ fontFamily: fontFamily.regular,
247
+ fontWeight: '400',
248
+ color: '#1B244B',
249
+ textAlign: 'center',
250
+ textAlignVertical: 'center',
251
+ padding: 0,
252
+ },
212
253
  });
213
254
 
214
255
  export default SelectableOption;
@@ -13,7 +13,7 @@ declare namespace SelectableOption {
13
13
  }
14
14
  }
15
15
  import React from 'react';
16
- declare function Item({ label, value, checked, disabled, onPress, backgroundColor, borderLeftColor, borderLeftWidth, height, borderRadius, padding, style, checkColor, checkIconSize, checkBoxSize, checkBorderRadius, checkIcon, checkBorderColor, checkBorderWidth, checkBackgroundColor, checkUncheckedBackgroundColor, labelStyle, valueBorderColor, valueBorderWidth, valueBorderRadius, valueBackgroundColor, valueWidth, valueHeight, valuePaddingHorizontal, valuePaddingVertical, valueStyle, valueContainerStyle, testID, }: {
16
+ declare function Item({ label, value, checked, disabled, onPress, backgroundColor, borderLeftColor, borderLeftWidth, height, borderRadius, padding, style, checkColor, checkIconSize, checkBoxSize, checkBorderRadius, checkIcon, checkBorderColor, checkBorderWidth, checkBackgroundColor, checkUncheckedBackgroundColor, labelStyle, valueBorderColor, valueBorderWidth, valueBorderRadius, valueBackgroundColor, valueWidth, valueHeight, valuePaddingHorizontal, valuePaddingVertical, valueStyle, valueContainerStyle, valueEditable, onChangeValue, valuePlaceholder, valueKeyboardType, valuePlaceholderTextColor, valueMaxLength, valueTestID, testID, }: {
17
17
  label: any;
18
18
  value: any;
19
19
  checked?: boolean | undefined;
@@ -46,6 +46,13 @@ declare function Item({ label, value, checked, disabled, onPress, backgroundColo
46
46
  valuePaddingVertical?: number | undefined;
47
47
  valueStyle: any;
48
48
  valueContainerStyle: any;
49
+ valueEditable?: boolean | undefined;
50
+ onChangeValue: any;
51
+ valuePlaceholder?: string | undefined;
52
+ valueKeyboardType?: string | undefined;
53
+ valuePlaceholderTextColor?: string | undefined;
54
+ valueMaxLength: any;
55
+ valueTestID: any;
49
56
  testID: any;
50
57
  }): React.JSX.Element;
51
58
  declare namespace Item {
@@ -83,6 +90,13 @@ declare namespace Item {
83
90
  export let valuePaddingVertical: any;
84
91
  export let valueStyle: any;
85
92
  export let valueContainerStyle: any;
93
+ export let valueEditable: any;
94
+ export let onChangeValue: any;
95
+ export let valuePlaceholder: any;
96
+ export let valueKeyboardType: any;
97
+ export let valuePlaceholderTextColor: any;
98
+ export let valueMaxLength: any;
99
+ export let valueTestID: any;
86
100
  export let testID: any;
87
101
  }
88
102
  export { propTypes_1 as propTypes };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/SelectableOption/index.jsx"],"names":[],"mappings":";AAOA;;;;sBAMC;;;;;;;;;kBAbiB,OAAO;AAezB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgHC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../components/SelectableOption/index.jsx"],"names":[],"mappings":";AAOA;;;;sBAMC;;;;;;;;;kBAbiB,OAAO;AAezB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAuIC"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import { View, Pressable, StyleSheet } from 'react-native';
3
+ import { View, Pressable, StyleSheet, TextInput } from 'react-native';
4
4
  import Icon from '../Icon';
5
5
  import SEText from '../SEText';
6
6
  import { fontFamily } from '../utils/fontFamily';
@@ -17,7 +17,7 @@ checkColor = '#687499', checkIconSize = 10, checkBoxSize = 13, checkBorderRadius
17
17
  // Label
18
18
  labelStyle,
19
19
  // Value card
20
- valueBorderColor = '#E2E9FC', valueBorderWidth = 2, valueBorderRadius = 8, valueBackgroundColor = '#FFFFFF', valueWidth = 161, valueHeight = 48, valuePaddingHorizontal = 8, valuePaddingVertical = 8, valueStyle, valueContainerStyle,
20
+ valueBorderColor = '#E2E9FC', valueBorderWidth = 2, valueBorderRadius = 8, valueBackgroundColor = '#FFFFFF', valueWidth = 161, valueHeight = 48, valuePaddingHorizontal = 8, valuePaddingVertical = 8, valueStyle, valueContainerStyle, valueEditable = false, onChangeValue, valuePlaceholder = '', valueKeyboardType = 'numeric', valuePlaceholderTextColor = '#687499', valueMaxLength, valueTestID,
21
21
  // Test
22
22
  testID, }) => {
23
23
  const resolvedCheckBorderColor = checkBorderColor || checkColor;
@@ -71,9 +71,9 @@ testID, }) => {
71
71
  },
72
72
  valueContainerStyle,
73
73
  ]}>
74
- <SEText type="ns-sm-body" style={[styles.value, valueStyle]}>
75
- {value}
76
- </SEText>
74
+ {valueEditable ? (<TextInput value={String(value ?? '')} onChangeText={onChangeValue} keyboardType={valueKeyboardType} placeholder={valuePlaceholder} placeholderTextColor={valuePlaceholderTextColor} maxLength={valueMaxLength} editable={!disabled} textAlign="center" underlineColorAndroid="transparent" style={[styles.valueInput, valueStyle]} testID={valueTestID}/>) : (<SEText type="ns-sm-body" style={[styles.value, valueStyle]}>
75
+ {value}
76
+ </SEText>)}
77
77
  </View>)}
78
78
  </Pressable>);
79
79
  };
@@ -110,6 +110,13 @@ Item.propTypes = {
110
110
  valuePaddingVertical: PropTypes.number,
111
111
  valueStyle: PropTypes.object,
112
112
  valueContainerStyle: PropTypes.object,
113
+ valueEditable: PropTypes.bool,
114
+ onChangeValue: PropTypes.func,
115
+ valuePlaceholder: PropTypes.string,
116
+ valueKeyboardType: PropTypes.string,
117
+ valuePlaceholderTextColor: PropTypes.string,
118
+ valueMaxLength: PropTypes.number,
119
+ valueTestID: PropTypes.string,
113
120
  testID: PropTypes.string,
114
121
  };
115
122
  SelectableOption.Item = Item;
@@ -156,5 +163,16 @@ const styles = StyleSheet.create({
156
163
  color: '#1B244B',
157
164
  textAlign: 'center',
158
165
  },
166
+ valueInput: {
167
+ width: '100%',
168
+ height: '100%',
169
+ fontSize: 18,
170
+ fontFamily: fontFamily.regular,
171
+ fontWeight: '400',
172
+ color: '#1B244B',
173
+ textAlign: 'center',
174
+ textAlignVertical: 'center',
175
+ padding: 0,
176
+ },
159
177
  });
160
178
  export default SelectableOption;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vpt-sebraeds",
3
- "version": "0.0.88",
3
+ "version": "0.0.89",
4
4
  "description": "Biblioteca de componentes React Native do Sebrae",
5
5
  "main": "dist/src/index.js",
6
6
  "types": "dist/src/index.d.ts",