Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.9.10"
"version": "1.0.0"
}
4 changes: 2 additions & 2 deletions src/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class Form extends React.Component{
key: child.ref || child.type+i,
fieldRef : child.ref,
ref: child.ref,
onFocus:this.handleFieldFocused.bind(this),
onChange:this.handleFieldChange.bind(this, child.ref)
onFocus: this.handleFieldFocused.bind(this),
onChange: this.handleFieldChange.bind(this, child.ref)
}
));
}, this);
Expand Down
2 changes: 1 addition & 1 deletion src/fields/CountDownField.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class CountDownField extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
2 changes: 1 addition & 1 deletion src/fields/DatePickerField.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class DatePickerField extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
2 changes: 1 addition & 1 deletion src/fields/DatePickerField.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class DatePickerField extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
11 changes: 5 additions & 6 deletions src/fields/InputField.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export class InputField extends React.Component{
this.props.style
]}
containerStyle={[formStyles.fieldContainer,
formStyles.horizontalContainer,
this.props.containerStyle,
]}
formStyles.horizontalContainer,
this.props.containerStyle,
]}
/>
)
}
Expand Down Expand Up @@ -65,7 +65,7 @@ let formStyles = StyleSheet.create({
textAlign: 'right'
},
multiline:{
lineHeight: 32,
lineHeight: 45,
fontSize: 34/2,
paddingBottom:10
},
Expand Down Expand Up @@ -98,8 +98,7 @@ let formStyles = StyleSheet.create({
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32,

lineHeight: 45,
},
input:{
paddingLeft: 10,
Expand Down
2 changes: 1 addition & 1 deletion src/fields/LinkField.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ let formStyles = StyleSheet.create({
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
});
2 changes: 1 addition & 1 deletion src/fields/LinkField.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let formStyles = StyleSheet.create({
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32,
lineHeight: 45,
flex:2
},
});
2 changes: 1 addition & 1 deletion src/fields/PickerField.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class PickerField extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
2 changes: 1 addition & 1 deletion src/fields/PickerField.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class PickerField extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
2 changes: 1 addition & 1 deletion src/fields/SwitchField.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class SwitchField extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},

});
2 changes: 1 addition & 1 deletion src/fields/TimePickerField.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class TimePickerField extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
2 changes: 1 addition & 1 deletion src/fields/TimePickerField.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class TimePickerField extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
6 changes: 5 additions & 1 deletion src/lib/DatePickerComponent.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import {Field} from './Field';
export class DatePickerComponent extends React.Component{
constructor(props){
super(props);
if (props.date) {
// Ensure initial value is retrieved in Form.getData()
if(this.props.onChange) this.props.onChange(props.date);
}
this.state = {
date: props.date? new Date(props.date) :'',
isPickerVisible: false
Expand Down Expand Up @@ -176,7 +180,7 @@ import {Field} from './Field';
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
11 changes: 9 additions & 2 deletions src/lib/DatePickerComponent.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import {Field} from './Field';
export class DatePickerComponent extends React.Component{
constructor(props){
super(props);
if (props.date) {
// Ensure initial value is retrieved in Form.getData()
if(this.props.onChange) this.props.onChange(props.date);
}
this.state = {
date: props.date? new Date(props.date) : '',
isPickerVisible: false
Expand Down Expand Up @@ -41,6 +45,9 @@ export class DatePickerComponent extends React.Component{

// this.refs.picker.measure(this.getPickerLayout.bind(this));

_isPickerVisible() {
return this.state.isPickerVisible
}

_togglePicker(event){
this.setState({isPickerVisible:!this.state.isPickerVisible});
Expand Down Expand Up @@ -107,7 +114,7 @@ export class DatePickerComponent extends React.Component{

</View>
</Field>
{(this.state.isPickerVisible)?
{(this.props.showing)?
pickerWrapper : null
}

Expand Down Expand Up @@ -204,7 +211,7 @@ let formStyles = StyleSheet.create({
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
9 changes: 5 additions & 4 deletions src/lib/Field.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import {HelpText} from './HelpText';
let { View, StyleSheet, Text, TouchableHighlight} = require('react-native');
let { View, StyleSheet, Text, TouchableHighlight, TouchableOpacity} = require('react-native');

export class Field extends React.Component{
render(){
Expand All @@ -14,14 +14,15 @@ export class Field extends React.Component{
: null);

if(this.props.onPress){
return <TouchableHighlight onPress={this.props.onPress}>
return <TouchableOpacity style={{
}} onPress={this.props.onPress}>
<View>
{this.props.children}
{fieldHelpText}
</View>
</TouchableHighlight>
</TouchableOpacity>
}
return <View>
return <View>
{this.props.children}
{fieldHelpText}
</View>;
Expand Down
5 changes: 5 additions & 0 deletions src/lib/InputComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export class InputComponent extends React.Component{
constructor(props){
super(props);

if (props.value) {
// Ensure initial value is retrieved in Form.getData()
if(this.props.onChange) this.props.onChange(props.value, this.valid);
}

this.triggerValidation = this.triggerValidation.bind(this);
// this.validate = this.validate.bind(this)
this.validate(props.value);
Expand Down
4 changes: 4 additions & 0 deletions src/lib/LinkComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {Field} from './Field';
export class LinkComponent extends React.Component{
constructor(props){
super(props);
if (props.value) {
// Ensure initial value is retrieved in Form.getData()
if(this.props.onChange) this.props.onChange(props.value, this.valid);
}
this.state = {
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/lib/PickerComponent.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ var PickerItem = Picker.Item;
export class PickerComponent extends React.Component{
constructor(props){
super(props);
if (props.value) {
// Ensure initial value is retrieved in Form.getData()
if(this.props.onChange) this.props.onChange(props.value, this.valid);
}
this.state = {
value: props.value || props.label,
}
Expand Down Expand Up @@ -151,7 +155,7 @@ var PickerItem = Picker.Item;
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
8 changes: 6 additions & 2 deletions src/lib/PickerComponent.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ var PickerItem = Picker.Item;
export class PickerComponent extends React.Component{
constructor(props){
super(props);
if (props.value) {
// Ensure initial value is retrieved in Form.getData()
if(this.props.onChange) this.props.onChange(props.value, this.valid);
}
this.state = {
value: props.value,
isPickerVisible: false
Expand Down Expand Up @@ -144,7 +148,7 @@ export class PickerComponent extends React.Component{

</View>
</Field>
{(this.state.isPickerVisible)?
{(this.props.showing)?
pickerWrapper : null
}

Expand Down Expand Up @@ -220,7 +224,7 @@ export class PickerComponent extends React.Component{
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
7 changes: 6 additions & 1 deletion src/lib/SwitchComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import {Field} from './Field';
export class SwitchComponent extends React.Component{
constructor(props){
super(props);
if (props.value) {
// Ensure initial value is retrieved in Form.getData()
if(this.props.onChange) this.props.onChange(props.value, this.valid);
}
this.state = {
value: props.value,
}
Expand Down Expand Up @@ -40,6 +44,7 @@ export class SwitchComponent extends React.Component{

<Text style={this.props.labelStyle}>{this.props.label}</Text>
<Switch
onTintColor={this.props.onTintColor}
onValueChange={this.handleValueChange.bind(this)}
style={this.props.switchStyle}
value={this.state.value} />
Expand Down Expand Up @@ -106,7 +111,7 @@ SwitchComponent.propTypes = {
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down
6 changes: 5 additions & 1 deletion src/lib/TimePickerComponent.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ import {Field} from './Field';
export class TimePickerComponent extends React.Component{
constructor(props){
super(props);
if (props.value) {
// Ensure initial value is retrieved in Form.getData()
if(this.props.onChange) this.props.onChange(props.value, this.valid);
}
this.state = {
date: props.date? new Date(props.date) :'',
isPickerVisible: false
Expand Down Expand Up @@ -167,7 +171,7 @@ import {Field} from './Field';
paddingLeft: 10,
paddingRight: 10,
justifyContent: 'center',
lineHeight: 32
lineHeight: 45
},
input:{
paddingLeft: 10,
Expand Down