mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-21 00:14:44 +08:00
Merge branch 'master' into lessPlugin
This commit is contained in:
commit
154e6781ec
@ -355,6 +355,55 @@ exports[`renders ./components/select/demo/custom-dropdown-menu.md correctly 1`]
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/select/demo/hide-selected.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-select ant-select-enabled"
|
||||
style="width:100%"
|
||||
>
|
||||
<div
|
||||
aria-autocomplete="list"
|
||||
aria-controls="test-uuid"
|
||||
aria-expanded="false"
|
||||
aria-haspopup="true"
|
||||
class="ant-select-selection
|
||||
ant-select-selection--multiple"
|
||||
role="combobox"
|
||||
>
|
||||
<div
|
||||
class="ant-select-selection__rendered"
|
||||
>
|
||||
<div
|
||||
class="ant-select-selection__placeholder"
|
||||
style="display:block;user-select:none;-webkit-user-select:none"
|
||||
unselectable="on"
|
||||
>
|
||||
Inserted are removed
|
||||
</div>
|
||||
<ul>
|
||||
<li
|
||||
class="ant-select-search ant-select-search--inline"
|
||||
>
|
||||
<div
|
||||
class="ant-select-search__field__wrap"
|
||||
>
|
||||
<input
|
||||
autocomplete="off"
|
||||
class="ant-select-search__field"
|
||||
value=""
|
||||
/>
|
||||
<span
|
||||
class="ant-select-search__field__mirror"
|
||||
>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/select/demo/label-in-value.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-select ant-select-enabled"
|
||||
|
52
components/select/demo/hide-selected.md
Normal file
52
components/select/demo/hide-selected.md
Normal file
@ -0,0 +1,52 @@
|
||||
---
|
||||
order: 22
|
||||
title:
|
||||
zh-CN: 隐藏已选择选项
|
||||
en-US: Hide Already Selected
|
||||
---
|
||||
|
||||
## zh-CN
|
||||
|
||||
隐藏下拉列表中已选择的选项。
|
||||
|
||||
## en-US
|
||||
|
||||
Hide already selected options in the dropdown.
|
||||
|
||||
````jsx
|
||||
import { Select } from 'antd';
|
||||
|
||||
const OPTIONS = ['Apples', 'Nails', 'Bananas', 'Helicopters'];
|
||||
|
||||
class SelectWithHiddenSelectedOptions extends React.Component {
|
||||
state = {
|
||||
selectedItems: [],
|
||||
};
|
||||
|
||||
handleChange = selectedItems => {
|
||||
this.setState({ selectedItems });
|
||||
};
|
||||
|
||||
render() {
|
||||
const { selectedItems } = this.state;
|
||||
const filteredOptions = OPTIONS.filter(o => !selectedItems.includes(o));
|
||||
return (
|
||||
<Select
|
||||
mode="multiple"
|
||||
placeholder="Inserted are removed"
|
||||
value={selectedItems}
|
||||
onChange={this.handleChange}
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
{filteredOptions.map(item => (
|
||||
<Select.Option key={item} value={item}>
|
||||
{item}
|
||||
</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
ReactDOM.render(<SelectWithHiddenSelectedOptions />, mountNode);
|
||||
````
|
@ -102,13 +102,13 @@
|
||||
"ansi-styles": "^3.2.1",
|
||||
"ant-design-palettes": "^1.1.3",
|
||||
"antd-theme-generator": "^1.1.4",
|
||||
"antd-tools": "^6.1.1",
|
||||
"antd-tools": "^6.1.3",
|
||||
"babel-cli": "^6.26.0",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"bisheng": "^1.0.0",
|
||||
"bisheng-plugin-antd": "^0.17.0",
|
||||
"bisheng-plugin-description": "^0.1.4",
|
||||
"bisheng-plugin-react": "^0.6.3",
|
||||
"bisheng-plugin-react": "^1.0.0",
|
||||
"bisheng-plugin-toc": "^0.4.4",
|
||||
"commander": "^2.18.0",
|
||||
"core-js": "^2.5.7",
|
||||
|
Loading…
Reference in New Issue
Block a user