* Input: fix #5322

* Refactor preSuffix to affix

* Update tests and demos

* Refactor preSuffix to affix
This commit is contained in:
Qingrong Ke 2017-03-18 21:26:42 +08:00 committed by 偏右
parent 69dff0fa2d
commit 8afc2e9e95
9 changed files with 23 additions and 23 deletions

View File

@ -144,7 +144,7 @@ exports[`renders ./components/auto-complete/demo/certain-category.md correctly 1
class="ant-select-search__field__wrap"
>
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
>
<input
class="ant-input ant-input ant-select-search__field"
@ -325,7 +325,7 @@ exports[`renders ./components/auto-complete/demo/uncertain-category.md correctly
class="ant-select-search__field__wrap"
>
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
>
<input
class="ant-input ant-input ant-select-search__field"

View File

@ -105,7 +105,7 @@ ReactDOM.render(<Complete />, mountNode);
````
````css
.certain-category-search.ant-select-auto-complete .ant-input-preSuffix-wrapper .ant-input-suffix {
.certain-category-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix {
right: 12px;
}

View File

@ -106,15 +106,15 @@ ReactDOM.render(<Complete />, mountNode);
margin-right: -46px;
}
.global-search.ant-select-auto-complete .ant-input-preSuffix-wrapper .ant-input:not(:last-child) {
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input:not(:last-child) {
padding-right: 62px;
}
.global-search.ant-select-auto-complete .ant-input-preSuffix-wrapper .ant-input-suffix {
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix {
right: 0;
}
.global-search.ant-select-auto-complete .ant-input-preSuffix-wrapper .ant-input-suffix button {
.global-search.ant-select-auto-complete .ant-input-affix-wrapper .ant-input-suffix button {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}

View File

@ -598,7 +598,7 @@ exports[`renders ./components/form/demo/horizontal-login.md correctly 1`] = `
class="ant-form-item-control "
>
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
>
<span
class="ant-input-prefix"
@ -630,7 +630,7 @@ exports[`renders ./components/form/demo/horizontal-login.md correctly 1`] = `
class="ant-form-item-control "
>
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
>
<span
class="ant-input-prefix"
@ -853,7 +853,7 @@ exports[`renders ./components/form/demo/normal-login.md correctly 1`] = `
class="ant-form-item-control "
>
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
>
<span
class="ant-input-prefix"
@ -885,7 +885,7 @@ exports[`renders ./components/form/demo/normal-login.md correctly 1`] = `
class="ant-form-item-control "
>
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
>
<span
class="ant-input-prefix"

View File

@ -207,7 +207,7 @@ export default class Input extends Component<InputProps, any> {
) : null;
return (
<span className={`${props.prefixCls}-preSuffix-wrapper`} style={props.style}>
<span className={`${props.prefixCls}-affix-wrapper`} style={props.style}>
{prefix}
{cloneElement(children, { style: null })}
{suffix}

View File

@ -426,7 +426,7 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
exports[`renders ./components/input/demo/presuffix.md correctly 1`] = `
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
>
<span
class="ant-input-prefix"
@ -446,7 +446,7 @@ exports[`renders ./components/input/demo/presuffix.md correctly 1`] = `
exports[`renders ./components/input/demo/search-input.md correctly 1`] = `
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
style="width:200px;"
>
<input

View File

@ -13,7 +13,7 @@
.input-group(~"@{ant-prefix}-input");
}
// Input with suffix
.@{ant-prefix}-input-preSuffix-wrapper {
.input-preSuffix-wrapper(~"@{ant-prefix}-input");
// Input with affix: prefix or suffix
.@{ant-prefix}-input-affix-wrapper {
.input-affix-wrapper(~"@{ant-prefix}-input");
}

View File

@ -1,7 +1,7 @@
@import "../../style/themes/default";
@import "../../style/mixins/index";
@input-presuffix-width: 17;
@input-affix-width: 17;
// size mixins for input
.input-lg() {
@ -188,7 +188,7 @@
}
}
> .@{inputClass}-preSuffix-wrapper {
> .@{inputClass}-affix-wrapper {
&:not(:first-child) .@{inputClass} {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
@ -230,7 +230,7 @@
.input-sm();
}
.@{inputClass}-preSuffix-wrapper {
.@{inputClass}-affix-wrapper {
display: table-cell;
width: 100%;
float: left;
@ -273,7 +273,7 @@
}
}
.input-preSuffix-wrapper(@inputClass) {
.input-affix-wrapper(@inputClass) {
position: relative;
display: inline-block;
width: 100%;
@ -304,10 +304,10 @@
}
.@{inputClass}:not(:first-child) {
padding-left: @input-padding-horizontal + @input-presuffix-width;
padding-left: @input-padding-horizontal + @input-affix-width;
}
.@{inputClass}:not(:last-child) {
padding-right: @input-padding-horizontal + @input-presuffix-width;
padding-right: @input-padding-horizontal + @input-affix-width;
}
}

View File

@ -685,7 +685,7 @@ exports[`renders ./components/tree/demo/dynamic.md correctly 1`] = `
exports[`renders ./components/tree/demo/search.md correctly 1`] = `
<div>
<span
class="ant-input-preSuffix-wrapper"
class="ant-input-affix-wrapper"
style="width:300px;"
>
<input