muba-input-text 5.0.1 → 5.0.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/InputText.js CHANGED
@@ -96,7 +96,9 @@ export default class InputText extends React.Component {
96
96
  }
97
97
  }
98
98
 
99
- result = this.validateType() && result;
99
+ if (this.props.required || this.props.value != null) {
100
+ result = this.validateType() && result;
101
+ }
100
102
  }
101
103
 
102
104
  return result;
@@ -250,10 +252,10 @@ export default class InputText extends React.Component {
250
252
  <View style={{ marginTop: 10 }} />
251
253
  }
252
254
 
253
- <View style={inputTextStyles.row} collapsable={false}>
255
+ <View style={(isRTL() && (this.props.language == null || this.props.language == 'AR')) || (!isRTL() && (this.props.language == null || this.props.language != 'AR')) ? inputTextStyles.row : inputTextStyles.rowReverse} collapsable={false}>
254
256
  <TextInput
255
257
  ref={(input) => { this.input = input; }}
256
- style={[inputTextStyles.textInputField, inputTextStyles.textField, this.props.style, { textAlign: isRTL() || this.props.language == 'AR' ? 'right' : 'left' }, this.state.fieldError && !this.props.label ? inputTextStyles.fieldError : '', this.props.disabled ? inputTextStyles.disabled : '', this.props.multiline ? { paddingTop: 5 } : '']}
258
+ style={[inputTextStyles.textInputField, inputTextStyles.textField, this.props.style, { textAlign: (isRTL() && (this.props.language == null || this.props.language == 'AR')) || this.props.language == 'AR' ? 'right' : 'left' }, this.state.fieldError && !this.props.label ? inputTextStyles.fieldError : '', this.props.disabled ? inputTextStyles.disabled : '', this.props.multiline ? { paddingTop: 5 } : '']}
257
259
  underlineColorAndroid='transparent'
258
260
  keyboardType={this.props.keyboardType ? this.props.keyboardType : keyboardTypeMap[this.props.type ? this.props.type : 'default']}
259
261
  onChangeText={(text) => this.onChangeText(text)}
@@ -11,6 +11,10 @@ export const inputTextStyles = StyleSheet.create({
11
11
  flexDirection: 'row'
12
12
  },
13
13
 
14
+ rowReverse: {
15
+ flexDirection: 'row-reverse'
16
+ },
17
+
14
18
  progressbarField: {
15
19
  fontFamily: Fonts.Note,
16
20
  fontSize: 12,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muba-input-text",
3
- "version": "5.0.1",
3
+ "version": "5.0.3",
4
4
  "description": "Input text",
5
5
  "main": "InputText.js",
6
6
  "scripts": {