Browse Source

deps: update rc-select (#3692)

* Update rc-select

* Add automatic tokenization demo
pull/3668/head
Wei Zhu 8 years ago
committed by Benjy Cui
parent
commit
5c711a275e
  1. 38
      components/select/demo/automatic-tokenization.md
  2. 4
      components/select/index.en-US.md
  3. 3
      components/select/index.zh-CN.md
  4. 2
      package.json

38
components/select/demo/automatic-tokenization.md

@ -0,0 +1,38 @@
---
order: 11
title:
zh-CN: 自动分词
en-US: Automatic tokenization
---
## zh-CN
试下复制`露西,杰克`到输入框里。只在 tags 和 multiple 模式下可用。
## en-US
Try copy `Lucy,Jack` to the input. Only available in tags and multiple mode.
````jsx
import { Select } from 'antd';
const Option = Select.Option;
const children = [];
for (let i = 10; i < 36; i++) {
children.push(<Option key={i.toString(36) + i}>{i.toString(36) + i}</Option>);
}
function handleChange(value) {
console.log(`selected ${value}`);
}
ReactDOM.render(
<Select tags
style={{ width: '100%' }}
onChange={handleChange}
tokenSeparators={[',']}
>
{children}
</Select>
, mountNode);
````

4
components/select/index.en-US.md

@ -33,6 +33,8 @@ A Selector similar to Select2.
| onDeselect | Called when a option is deselected. param is option's value. only called for multiple or tags, effective in multiple or tags mode only. | function(value) | - |
| onChange | Called when select an option or input value change, or value of input is changed in combobox mode | function(value, label) | - |
| onSearch | Callback function that is fired when input changed. | function(value: String) | |
| onBlur | Called when blur | function | - |
| onFocus | Called when focus | function | - |
| placeholder | Placeholder of select | string | - |
| notFoundContent | Specify content to show when no result matches..| string | 'Not Found' |
| dropdownMatchSelectWidth | Whether dropdown's with is same with select. | boolean | true |
@ -46,6 +48,8 @@ A Selector similar to Select2.
| dropdownClassName | className of dropdown menu | string | - |
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative.[example](http://codepen.io/anon/pen/xVBOVQ?editors=001) | function(triggerNode) | () => document.body |
| labelInValue | whether to embed label in value | boolean | false |
| tokenSeparators | Separator used to tokenize on tag/multiple mode | string[]? | |
### Option props

3
components/select/index.zh-CN.md

@ -34,6 +34,8 @@ title: Select
| onDeselect | 取消选中时调用,参数为选中项的 option value 值,仅在 multiple 或 tags 模式下生效 | function(value) | 无 |
| onChange | 选中 option,或 input 的 value 变化(combobox 模式下)时,调用此函数 | function(value) | 无 |
| onSearch | 文本框值变化时回调 | function(value: String) | |
| onBlur | 失去焦点的时回调 | function | - |
| onFocus | 获得焦点时回调 | function | - |
| placeholder | 选择框默认文字 | string | 无 |
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' |
| dropdownMatchSelectWidth | 下拉菜单和选择器同宽 | boolean | true |
@ -48,6 +50,7 @@ title: Select
| dropdownClassName | 下拉菜单的 className 属性 | string | - |
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](http://codepen.io/anon/pen/xVBOVQ?editors=001) | Function(triggerNode) | () => document.body |
| labelInValue | 是否把每个选项的 label 包装到 value 中,决定 Select 的 value 类型。 | boolean | false |
| tokenSeparators | 在 tags 和 multiple 模式下自动分词的分隔符 | string[]? | |
### Option props

2
package.json

@ -59,7 +59,7 @@
"rc-queue-anim": "~0.12.4",
"rc-radio": "~2.0.0",
"rc-rate": "~1.1.2",
"rc-select": "~6.5.1",
"rc-select": "^6.6.1",
"rc-slider": "~5.2.0",
"rc-steps": "~2.2.0",
"rc-switch": "~1.4.2",

Loading…
Cancel
Save