Browse Source

add check icon in multi select

pull/11809/merge
HeskeyBaozi 6 years ago
committed by 偏右
parent
commit
ace857d8bf
  1. 5
      components/select/index.tsx
  2. 10
      components/select/style/index.less
  3. 2
      package.json

5
components/select/index.tsx

@ -182,10 +182,15 @@ export default class Select extends React.Component<SelectProps, {}> {
<Icon type="close" className={`${prefixCls}-remove-icon`} /> <Icon type="close" className={`${prefixCls}-remove-icon`} />
); );
const menuItemSelectedIcon = (
<Icon type="check" className={`${prefixCls}-selected-icon`} />
);
return ( return (
<RcSelect <RcSelect
inputIcon={inputIcon} inputIcon={inputIcon}
removeIcon={removeIcon} removeIcon={removeIcon}
menuItemSelectedIcon={menuItemSelectedIcon}
{...restProps} {...restProps}
{...modeConfig} {...modeConfig}
prefixCls={prefixCls} prefixCls={prefixCls}

10
components/select/style/index.less

@ -541,7 +541,7 @@
&&--multiple { &&--multiple {
.@{select-prefix-cls}-dropdown-menu-item { .@{select-prefix-cls}-dropdown-menu-item {
&:after { & .@{select-prefix-cls}-selected-icon {
color: transparent; color: transparent;
.iconfont-size-under-12px(10px); .iconfont-size-under-12px(10px);
transition: all 0.2s ease; transition: all 0.2s ease;
@ -553,16 +553,16 @@
text-shadow: 0 0.1px 0, 0.1px 0 0, 0 -0.1px 0, -0.1px 0; text-shadow: 0 0.1px 0, 0.1px 0 0, 0 -0.1px 0, -0.1px 0;
} }
&:hover:after { &:hover .@{select-prefix-cls}-selected-icon {
color: #ddd; color: #ddd;
} }
&-disabled:after { &-disabled .@{select-prefix-cls}-selected-icon {
display: none; display: none;
} }
&-selected:after, &-selected .@{select-prefix-cls}-selected-icon,
&-selected:hover:after { &-selected:hover .@{select-prefix-cls}-selected-icon {
color: @primary-color; color: @primary-color;
display: inline-block; display: inline-block;
} }

2
package.json

@ -71,7 +71,7 @@
"rc-pagination": "~1.17.0", "rc-pagination": "~1.17.0",
"rc-progress": "~2.2.2", "rc-progress": "~2.2.2",
"rc-rate": "~2.4.0", "rc-rate": "~2.4.0",
"rc-select": "~8.2.3", "rc-select": "~8.2.6",
"rc-slider": "~8.6.0", "rc-slider": "~8.6.0",
"rc-steps": "~3.3.0", "rc-steps": "~3.3.0",
"rc-switch": "~1.7.0", "rc-switch": "~1.7.0",

Loading…
Cancel
Save