Socket
Socket
Sign inDemoInstall

nuke-input

Package Overview
Dependencies
8
Maintainers
4
Versions
185
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.2.18 to 2.2.19

12

CHANGELOG.md

@@ -6,2 +6,14 @@ # Change Log

<a name="2.2.19"></a>
## [2.2.19](https://gitlab.alibaba-inc.com/nuke/input/compare/v2.2.18...v2.2.19) (2018-10-08)
### Bug Fixes
* fix width:null wrong behavior in daraz app ([a008ede](https://gitlab.alibaba-inc.com/nuke/input/commit/a008ede))
<a name="2.2.18"></a>

@@ -8,0 +20,0 @@ ## [2.2.18](https://gitlab.alibaba-inc.com/nuke/input/compare/v2.2.17...v2.2.18) (2018-09-30)

94

docs/autofocus.md

@@ -9,6 +9,5 @@ # Input demo

````js
```js
/** @jsx createElement */
import {createElement, Component,findDOMNode,render } from 'rax';
import { createElement, Component, findDOMNode, render } from 'rax';
import View from 'nuke-view';

@@ -24,36 +23,52 @@ import Text from 'nuke-text';

this.state = {
input:'',
value:'',
}
input: '',
value: ''
};
}
focus = (e) => {
this.refs.myinput.wrappedInstance.focus();
}
};
blur = (e) => {
this.refs.myinput.wrappedInstance.blur();
}
};
change = (value) => {
this.setState({value:value})
}
this.setState({ value: value });
};
input = (e) => {
this.setState({input:e.value})
}
return = (e) => {
}
this.setState({ input: e.value });
};
return = (e) => {};
render() {
return (
<Page title="Input">
<Page.Intro main="autoFocus"></Page.Intro>
<Page.Intro main="autoFocus" />
<View style={styles.lineWithMargin}>
<Input autoFocus preventEnterKey onReturn={this.return} returnKeyType="done" ref="myinput" onInput={this.input} onChange={this.change}/>
<Input
autoFocus
onReturn={this.return}
returnKeyType="done"
ref="myinput"
onInput={this.input}
onChange={this.change}
/>
</View>
<View style={[styles.lineWithMargin,styles.textLine]}>
<Text style={styles.text}>用户输入:{this.state.value}</Text>
<View style={[styles.lineWithMargin, styles.textLine]}>
<Text style={styles.text}>
用户输入:
{this.state.value}
</Text>
</View>
<View style={[styles.lineWithMargin,styles.textLine]}>
<Text style={styles.text}>onInput:{this.state.input}</Text>
<View style={[styles.lineWithMargin, styles.textLine]}>
<Text style={styles.text}>
onInput:
{this.state.input}
</Text>
</View>
<View style={styles.btns}>
<Button style={styles.btn} block type="primary" onPress={this.focus}>获得焦点</Button>
<Button style={styles.btn} block type="primary" onPress={this.blur}>失去焦点</Button>
<Button style={styles.btn} block type="primary" onPress={this.focus}>
获得焦点
</Button>
<Button style={styles.btn} block type="primary" onPress={this.blur}>
失去焦点
</Button>
</View>

@@ -63,24 +78,23 @@ </Page>

}
}
const styles={
lineWithMargin:{
marginLeft:30,
marginRight:30,
};
const styles = {
lineWithMargin: {
marginLeft: 30,
marginRight: 30
},
textLine:{
marginTop:20,
marginBottom:40,
textLine: {
marginTop: 20,
marginBottom: 40
},
text:{
fontSize:26
text: {
fontSize: 26
},
btns:{
margin:30,
btns: {
margin: 30
},
btn:{
marginBottom:30
btn: {
marginBottom: 30
}
}
render(<App/>);
````
};
render(<App />);
```

@@ -18,6 +18,7 @@ # Input demo

import Env from 'nuke-env';
const { isWeex } = Env;
import Button from 'nuke-button';
import Page from 'nuke-page';
import { StyleProvider } from 'nuke-theme-provider';
const { isWeex } = Env;

@@ -24,0 +25,0 @@ const KEYS = {

# Input demo
* order: 3
- order: 3

@@ -28,3 +28,3 @@ input events

}
input = e => {
input = (e) => {
let text = e.value;

@@ -35,3 +35,3 @@ this.setState({

};
textareaInputHandler = e => {
textareaInputHandler = (e) => {
let text = e.value;

@@ -42,3 +42,3 @@ this.setState({

};
change = text => {
change = (text) => {
this.setState({

@@ -48,3 +48,4 @@ change: text

};
onReturnHandler = e => {
onReturnHandler = (e) => {
console.log(e.type);
this.setState({

@@ -56,3 +57,3 @@ returnKeyType: e.returnKeyType,

};
blur = e => {
blur = (e) => {
this.refs.myinput.wrappedInstance.blur();

@@ -65,10 +66,9 @@ };

<View style={styles.lineWithMargin}>
<Input
ref="myinput"
placeholder="输入完成点击按钮失去焦点"
onChange={this.change}
/>
<Input ref="myinput" placeholder="输入完成点击按钮失去焦点" onChange={this.change} />
</View>
<View style={[styles.lineWithMargin, styles.textLine]}>
<Text style={styles.text}>onChange:{this.state.change}</Text>
<Text style={styles.text}>
onChange:
{this.state.change}
</Text>

@@ -84,3 +84,6 @@ <Button style={styles.btn} block type="primary" onPress={this.blur}>

<View style={[styles.lineWithMargin, styles.textLine]}>
<Text style={styles.text}>onInput:{this.state.input}</Text>
<Text style={styles.text}>
onInput:
{this.state.input}
</Text>
</View>

@@ -93,3 +96,6 @@

<View style={[styles.lineWithMargin, styles.textLine]}>
<Text style={styles.text}>onInput:{this.state.textareainput}</Text>
<Text style={styles.text}>
onInput:
{this.state.textareainput}
</Text>
</View>

@@ -99,13 +105,7 @@

<View style={styles.lineWithMargin}>
<Input
placeholder="go"
id="sixth"
returnKeyType="go"
onReturn={this.onReturnHandler}
/>
<Input placeholder="go" id="sixth" returnKeyType="go" onReturn={this.onReturnHandler} />
</View>
<View style={[styles.lineWithMargin, styles.textLine]}>
<Text style={styles.text}>
return 类型: {this.state.returnKeyType} , 输入框值:{' '}
{this.state.returnValue}
return 类型: {this.state.returnKeyType} , 输入框值: {this.state.returnValue}
</Text>

@@ -112,0 +112,0 @@ </View>

{
"name": "nuke-input",
"version": "2.2.18",
"version": "2.2.19",
"description": "输入框",

@@ -28,10 +28,10 @@ "main": "lib/index",

"dependencies": {
"nuke-base-input": "^2.2.18",
"nuke-core": "^2.2.18",
"nuke-env": "^2.2.18",
"nuke-helper": "^2.2.18",
"nuke-image": "^2.2.18",
"nuke-text": "^2.2.18",
"nuke-theme-provider": "^2.2.18",
"nuke-view": "^2.2.18"
"nuke-base-input": "^2.2.19",
"nuke-core": "^2.2.19",
"nuke-env": "^2.2.19",
"nuke-helper": "^2.2.19",
"nuke-image": "^2.2.19",
"nuke-text": "^2.2.19",
"nuke-theme-provider": "^2.2.19",
"nuke-view": "^2.2.19"
},

@@ -50,5 +50,5 @@ "devDependencies": {

"mocha": "^3.4.2",
"nuke-button": "^2.2.18",
"nuke-icon": "^2.2.18",
"nuke-page": "^2.2.18",
"nuke-button": "^2.2.19",
"nuke-icon": "^2.2.19",
"nuke-page": "^2.2.19",
"resemblejs-node": "^1.0.0",

@@ -61,3 +61,3 @@ "webdriver-keycode": "^1.0.3"

"license": "Apache",
"gitHead": "854b86a59c94718da62efdc7c397974442afd5f3"
"gitHead": "d5f2f5e399fafc1d3577221f22aa98bdf9a4393b"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc