Skip to content

Commit

Permalink
[IMP] add 0.5.3 changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
binjie chen committed Mar 20, 2019
1 parent 5e1d2e6 commit e11f17b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ timeline: true
* 主版本号:含有破坏性更新和新特性,不在发布周期内。

---
## 0.5.3

`2018-03-20`

- 💄 `Input`: Input输入到达字符限制时显示提示。
- 🌟 `Modal`: Modal添加disableOk和disableCancel属性。
- 🌟 `TreeNode`: TreeNode添加wrapper属性。
- 🌟 `Icon`: 增加新的图标。
- 🌟 `IconSelect`: 增加showAll属性。

## 0.5.2

`2018-02-22`
Expand Down
23 changes: 18 additions & 5 deletions components/icon-select/IconSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const icons = Icon.icons;

export interface IconSelectProps extends SelectProps {
prefix?: string;
showAll?: boolean;
}
export interface IconSelectState {
current: number,
Expand All @@ -25,6 +26,7 @@ export default class IconSelect extends React.Component<IconSelectProps, IconSel
filter: true,
showArrow: false,
showCheckAll: false,
showAll: false,
};
icons: any;
rcSelect: React.ReactNode | null;
Expand All @@ -44,13 +46,24 @@ export default class IconSelect extends React.Component<IconSelectProps, IconSel
}

initIcon(current: number = 1, pageSize: number = 20, filterValue: string = '') {
const { showAll } = this.props;
const minIndex = (current - 1) * pageSize;
const maxIndex = current * pageSize;
let items = icons.favorite;
if (filterValue) {
items = icons.favorite.filter((name) => {
return name.toLowerCase().indexOf(filterValue.toLowerCase()) !== -1;
});
let items;
if (showAll) {
items = icons.default;
if (filterValue) {
items = icons.favorite.filter((name) => {
return name.toLowerCase().indexOf(filterValue.toLowerCase()) !== -1;
});
}
} else {
items = icons.favorite;
if (filterValue) {
items = icons.favorite.filter((name) => {
return name.toLowerCase().indexOf(filterValue.toLowerCase()) !== -1;
});
}
}
const total = items.length || 0;
const currentData = items.filter((name, index) => {
Expand Down
2 changes: 1 addition & 1 deletion components/select/demo/iconselect.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Icon Select.
import { IconSelect } from 'choerodon-ui';

ReactDOM.render(
<IconSelect style={{ width: '300px' }} defaultValue={['root']} />,
<IconSelect showAll style={{ width: '300px' }} defaultValue={['root']} />,
mountNode);
````

0 comments on commit e11f17b

Please sign in to comment.