refactor: remove span[disabled]

This commit is contained in:
Benjy Cui 2017-07-12 14:23:47 +08:00
parent 27a17428de
commit 9c7cec3e39
5 changed files with 9 additions and 9 deletions

View File

@ -226,7 +226,7 @@ export default class RangePicker extends React.Component<any, any> {
const start = inputValue[0];
const end = inputValue[1];
return (
<span className={props.pickerInputClass} disabled={props.disabled}>
<span className={props.pickerInputClass}>
<input
disabled={props.disabled}
readOnly

View File

@ -39,7 +39,7 @@
display: block;
}
&:hover &-input:not([disabled]) {
&:hover &-input:not(.@{ant-prefix}-input-disabled) {
border-color: @primary-color;
}

View File

@ -65,11 +65,10 @@ export default function wrapPicker(Picker, defaultFormat?: string): any {
const pickerClass = classNames({
[`${prefixCls}-picker`]: true,
});
const pickerInputClass = classNames({
[`${prefixCls}-picker-input`]: true,
[inputPrefixCls]: true,
const pickerInputClass = classNames(`${prefixCls}-picker-input`, inputPrefixCls, {
[`${inputPrefixCls}-lg`]: props.size === 'large',
[`${inputPrefixCls}-sm`]: props.size === 'small',
[`${inputPrefixCls}-disabled`]: props.disabled,
});
const locale = getComponentLocale(

View File

@ -192,10 +192,11 @@ export default class Input extends Component<InputProps, any> {
]);
const prefixCls = props.prefixCls;
const inputClassName = classNames(prefixCls, {
const inputClassName = classNames(prefixCls, props.className, {
[`${prefixCls}-sm`]: props.size === 'small',
[`${prefixCls}-lg`]: props.size === 'large',
}, props.className);
[`${prefixCls}-disabled`]: props.disabled,
});
if ('value' in props) {
otherProps.value = fixControlledValue(props.value);

View File

@ -63,7 +63,7 @@
.active();
}
&[disabled] {
&-disabled {
.disabled();
}
@ -307,7 +307,7 @@
z-index: 1;
}
&:hover .@{inputClass} {
&:hover .@{inputClass}:not(.@{inputClass}-disabled) {
.hover();
}