nuke-input
Advanced tools
Comparing version 2.0.6 to 2.0.7
# Input Demo | ||
- order: 4 | ||
- hide: true | ||
* order: 4 | ||
* hide: true | ||
material design 定制 | ||
@@ -11,6 +10,5 @@ | ||
````js | ||
```js | ||
/** @jsx createElement */ | ||
import {createElement, Component,render } from 'rax'; | ||
import { createElement, Component, render } from 'rax'; | ||
import View from 'nuke-view'; | ||
@@ -20,3 +18,3 @@ import Text from 'nuke-text'; | ||
import Page from 'nuke-page'; | ||
import { isWeb ,appInfo} from 'nuke-env'; | ||
import { isWeb, appInfo } from 'nuke-env'; | ||
import { StyleProvider } from 'nuke-theme-provider'; | ||
@@ -26,4 +24,10 @@ | ||
let md = { | ||
Core:{ | ||
[`color-brand1-6`]: '#ff6600', | ||
Core: { | ||
[`color-brand1-6`]: '#ff6600' | ||
}, | ||
Input: { | ||
'clear-top': 30, | ||
'clear-right': 24, | ||
'single-radius':20, | ||
'placeholder-color':'blue', | ||
} | ||
@@ -35,79 +39,95 @@ }; | ||
super(); | ||
this.state={ | ||
status:'error' | ||
} | ||
this.state = { | ||
status: 'error' | ||
}; | ||
} | ||
change=()=>{ | ||
change = () => { | ||
console.log('1213'); | ||
this.setState({ | ||
status:'success' | ||
}) | ||
} | ||
status: 'success' | ||
}); | ||
}; | ||
render() { | ||
return ( | ||
<StyleProvider style={md} androidConfigs={{materialDesign:isAndroid}}> | ||
<Page title="md 风格"> | ||
<Page.Intro main="normal"></Page.Intro> | ||
<StyleProvider style={md} androidConfigs={{ materialDesign: isAndroid }}> | ||
<Page title="用安卓打开或 h5 切安卓 UA"> | ||
<Page.Intro main="normal" /> | ||
<View style={styles.lineWithMargin}> | ||
<Input type="text" placeholder="Type something" /> | ||
<Input type="text" placeholder="Type something" placeholderColor="red" /> | ||
</View> | ||
<Page.Intro main="normal"></Page.Intro> | ||
<Page.Intro main="normal" /> | ||
<View style={styles.lineWithMargin}> | ||
<Input defaultValue={'Input text for a single line field with a max'} type="text" placeholder="Single-line input label" /> | ||
<Input | ||
defaultValue={'Input text for a single line field with a max'} | ||
type="text" | ||
placeholder="Single-line input label" | ||
hasClear={true} | ||
/> | ||
</View> | ||
<Page.Intro main="error"></Page.Intro> | ||
<Page.Intro main="error" /> | ||
<View style={styles.lineWithMargin}> | ||
<Input status={this.state.status} defaultValue={'Input text for a single line field with a max'} type="text" onChange={this.change} placeholder="Single-line input label" errorMessage={"try again!!!"} /> | ||
<Input | ||
status={this.state.status} | ||
defaultValue={'Input text for a single line field with a max'} | ||
type="text" | ||
onChange={this.change} | ||
placeholder="Single-line input label" | ||
errorMessage={'try again!!!'} | ||
/> | ||
</View> | ||
<Page.Intro main="textarea"></Page.Intro> | ||
<Page.Intro main="textarea" /> | ||
<View style={styles.lineWithMargin}> | ||
<Input defaultValue={this.state.defaultValue} style={styles.textarea} rows={30} multiple={true} placeholder="介绍一下" returnKeyType="next" onChange={this.changeHandler} onInput={this.inputHandler} onReturn={this.returnHandler} /> | ||
<Input | ||
defaultValue={this.state.defaultValue} | ||
style={styles.textarea} | ||
rows={30} | ||
multiple={true} | ||
placeholder="介绍一下" | ||
returnKeyType="next" | ||
onChange={this.changeHandler} | ||
onInput={this.inputHandler} | ||
onReturn={this.returnHandler} | ||
/> | ||
</View> | ||
</Page> | ||
</StyleProvider> | ||
); | ||
} | ||
} | ||
}; | ||
const styles={ | ||
lineWithMargin:{ | ||
marginLeft:'30rem', | ||
marginRight:'30rem', | ||
const styles = { | ||
lineWithMargin: { | ||
marginLeft: '30rem', | ||
marginRight: '30rem' | ||
}, | ||
textarea:{ | ||
height:200, | ||
marginBottom:20, | ||
borderWidth:1, | ||
borderStyle:'solid', | ||
borderColor:'#cccccc' | ||
textarea: { | ||
height: 200, | ||
marginBottom: 20, | ||
borderWidth: 1, | ||
borderStyle: 'solid', | ||
borderColor: '#cccccc' | ||
}, | ||
text:{ | ||
fontSize:26 | ||
text: { | ||
fontSize: 26 | ||
}, | ||
result : { | ||
height:200, | ||
margin:10, | ||
padding:10, | ||
result: { | ||
height: 200, | ||
margin: 10, | ||
padding: 10 | ||
}, | ||
resultLabel:{ | ||
color:'#999999' | ||
resultLabel: { | ||
color: '#999999' | ||
}, | ||
resultText : { | ||
lines:10, | ||
fontSize:28, | ||
marginTop:10 | ||
resultText: { | ||
lines: 10, | ||
fontSize: 28, | ||
marginTop: 10 | ||
}, | ||
row:{ | ||
paddingLeft:30, | ||
paddingRight:30 | ||
row: { | ||
paddingLeft: 30, | ||
paddingRight: 30 | ||
} | ||
}; | ||
} | ||
render(<App/>); | ||
```` | ||
render(<App />); | ||
``` |
# Changelog | ||
## 2.0.7 / 2018-06-28 | ||
* [[185b73a2](http://gitlab.alibaba-inc.com/nuke/input/commit/185b73a27ec4526040cb71cad5bbb9695782e38d)] - `fix` fix outter border | ||
## 1.0.57 / 2018-05-29 | ||
* [[bc0b399a](http://gitlab.alibaba-inc.com/nuke/input/commit/bc0b399a322902d21305fa477f7db101ef91dbaf)] - `fix` fix type update error | ||
## 2.0.6 / 2018-04-13 | ||
@@ -5,0 +13,0 @@ |
@@ -60,5 +60,5 @@ 'use strict'; | ||
if (nextProps.value !== null) { | ||
return nextProps.value !== this.props.value || nextProps.readOnly !== this.props.readOnly || nextProps.disabled !== this.props.disabled; | ||
return nextProps.value !== this.props.value || nextProps.readOnly !== this.props.readOnly || nextProps.type !== this.props.type || nextProps.disabled !== this.props.disabled; | ||
} | ||
return _typeof(nextProps.value) !== _typeof(this.props.value) || nextProps.readOnly !== this.props.readOnly || nextProps.disabled !== this.props.disabled; | ||
return _typeof(nextProps.value) !== _typeof(this.props.value) || nextProps.readOnly !== this.props.readOnly || nextProps.type !== this.props.type || nextProps.disabled !== this.props.disabled; | ||
} | ||
@@ -65,0 +65,0 @@ }, { |
@@ -361,2 +361,5 @@ 'use strict'; | ||
} | ||
if (outerStyle.backgroundColor) { | ||
delete outerStyle.backgroundColor; | ||
} | ||
// console.log(inputWrapperStyle) | ||
@@ -363,0 +366,0 @@ |
{ | ||
"name": "nuke-input", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "输入框", | ||
@@ -60,5 +60,5 @@ "main": "lib/index", | ||
"publishConfig": { | ||
"registry": "http://registry.npmjs.org" | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"license": "Apache" | ||
} |
@@ -28,2 +28,3 @@ 'use strict'; | ||
nextProps.readOnly !== this.props.readOnly || | ||
nextProps.type !== this.props.type || | ||
nextProps.disabled !== this.props.disabled | ||
@@ -35,2 +36,3 @@ ); | ||
nextProps.readOnly !== this.props.readOnly || | ||
nextProps.type !== this.props.type || | ||
nextProps.disabled !== this.props.disabled | ||
@@ -37,0 +39,0 @@ ); |
@@ -205,3 +205,3 @@ 'use strict'; | ||
const { icon = {} } = this.props; | ||
const { uri, onPress = () => {}, style = {} } = icon; | ||
const { uri, onPress = () => { }, style = {} } = icon; | ||
if (!uri) return null; | ||
@@ -286,2 +286,5 @@ return ( | ||
} | ||
if (outerStyle.backgroundColor) { | ||
delete outerStyle.backgroundColor; | ||
} | ||
// console.log(inputWrapperStyle) | ||
@@ -344,6 +347,6 @@ | ||
Input.defaultProps = { | ||
onFocus: () => {}, | ||
onInput: () => {}, | ||
onBlur: () => {}, | ||
onReturn: () => {}, | ||
onFocus: () => { }, | ||
onInput: () => { }, | ||
onBlur: () => { }, | ||
onReturn: () => { }, | ||
placeholder: '', | ||
@@ -350,0 +353,0 @@ readOnly: false, |
273153
5097