Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: merge feature into master #25275

Merged
merged 14 commits into from
Jun 29, 2020
1 change: 1 addition & 0 deletions components/back-top/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ cover: https://gw.alipayobjects.com/zos/alicdn/tJZ5jbTwX/BackTop.svg
| target | specifies the scrollable area dom node | () => HTMLElement | () => window | |
| visibilityHeight | the `BackTop` button will not show until the scroll height reaches this value | number | 400 | |
| onClick | a callback function, which can be executed when you click the button | Function | - | |
| duration | Time to return to top(ms) | number | 450 | 4.4.0 |
4 changes: 3 additions & 1 deletion components/back-top/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface BackTopProps {
children?: React.ReactNode;
className?: string;
style?: React.CSSProperties;
duration?: number;
visible?: boolean; // Only for test. Don't use it.
}

Expand Down Expand Up @@ -68,9 +69,10 @@ const BackTop: React.FC<BackTopProps> = props => {
};

const scrollToTop = (e: React.MouseEvent<HTMLDivElement>) => {
const { onClick, target } = props;
const { onClick, target, duration = 450 } = props;
scrollTo(0, {
getContainer: target || getDefaultTarget,
duration,
});
if (typeof onClick === 'function') {
onClick(e);
Expand Down
1 change: 1 addition & 0 deletions components/back-top/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ cover: https://gw.alipayobjects.com/zos/alicdn/tJZ5jbTwX/BackTop.svg
| target | 设置需要监听其滚动事件的元素,值为一个返回对应 DOM 元素的函数 | Function | () => window | |
| visibilityHeight | 滚动高度达到此参数值才出现 `BackTop` | number | 400 | |
| onClick | 点击按钮的回调函数 | Function | - | |
| duration | 回到顶部所需时间(ms) | number | 450 | 4.4.0 |
Original file line number Diff line number Diff line change
Expand Up @@ -14988,9 +14988,11 @@ exports[`ConfigProvider components InputNumber configProvider 1`] = `
class="config-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="config-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down Expand Up @@ -15066,9 +15068,11 @@ exports[`ConfigProvider components InputNumber configProvider componentSize larg
class="config-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="config-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down Expand Up @@ -15144,9 +15148,11 @@ exports[`ConfigProvider components InputNumber configProvider componentSize midd
class="config-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="config-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down Expand Up @@ -15222,9 +15228,11 @@ exports[`ConfigProvider components InputNumber configProvider virtual and dropdo
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down Expand Up @@ -15300,9 +15308,11 @@ exports[`ConfigProvider components InputNumber normal 1`] = `
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down Expand Up @@ -15378,9 +15388,11 @@ exports[`ConfigProvider components InputNumber prefixCls 1`] = `
class="prefix-InputNumber-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="prefix-InputNumber-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down
6 changes: 6 additions & 0 deletions components/form/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1908,10 +1908,12 @@ exports[`renders ./components/form/demo/nest-messages.md correctly 1`] = `
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="ant-input-number-input"
id="nest-messages_user_age"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down Expand Up @@ -3385,9 +3387,11 @@ exports[`renders ./components/form/demo/size.md correctly 1`] = `
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down Expand Up @@ -6322,9 +6326,11 @@ exports[`renders ./components/form/demo/validate-static.md correctly 1`] = `
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,12 @@ exports[`renders ./components/input-number/demo/formatter.md correctly 1`] = `
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
aria-valuenow="1000"
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ exports[`InputNumber rtl render component should be rendered correctly in RTL di
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down
6 changes: 3 additions & 3 deletions components/input-number/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ When a numeric value needs to be provided.
| defaultValue | initial value | number | |
| disabled | disable the input | boolean | false |
| formatter | Specifies the format of the value presented | function(value: number \| string): string | |
| max | max value | number | Infinity |
| min | min value | number | -Infinity |
| parser | Specifies the value extracted from formatter | function( string): number | |
| max | max value | number | [Number.MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) |
| min | min value | number | [Number.MIN_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER) |
| parser | Specifies the value extracted from formatter | function(string): number | |
| precision | precision of input value | number | |
| decimalSeparator | decimal separator | string | |
| size | height of input box | `large` \| `middle` \| `small` | |
Expand Down
4 changes: 2 additions & 2 deletions components/input-number/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ cover: https://gw.alipayobjects.com/zos/alicdn/XOS8qZ0kU/InputNumber.svg
| defaultValue | 初始值 | number | |
| disabled | 禁用 | boolean | false |
| formatter | 指定输入框展示值的格式 | function(value: number \| string): string | |
| max | 最大值 | number | Infinity |
| min | 最小值 | number | -Infinity |
| max | 最大值 | number | [Number.MAX_SAFE_INTEGER](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER) |
| min | 最小值 | number | [Number.MIN_SAFE_INTEGER](https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER) |
| parser | 指定从 `formatter` 里转换回数字的方式,和 `formatter` 搭配使用 | function(string): number | |
| precision | 数值精度 | number | |
| decimalSeparator | 小数点 | string | |
Expand Down
4 changes: 4 additions & 0 deletions components/input/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,11 @@ Array [
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down Expand Up @@ -1356,9 +1358,11 @@ exports[`renders ./components/input/demo/group.md correctly 1`] = `
class="ant-input-number-input-wrap"
>
<input
aria-valuemax="9007199254740991"
aria-valuemin="-9007199254740991"
autocomplete="off"
class="ant-input-number-input"
max="9007199254740991"
min="-9007199254740991"
role="spinbutton"
step="1"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"rc-drawer": "~4.0.0",
"rc-dropdown": "~3.1.2",
"rc-field-form": "~1.5.0",
"rc-input-number": "~5.0.0",
"rc-input-number": "~5.1.0",
"rc-mentions": "~1.3.0",
"rc-menu": "~8.3.0",
"rc-notification": "~4.4.0",
Expand Down