This commit is contained in:
二货机器人 2020-02-05 14:23:21 +08:00 committed by GitHub
parent 3fb7325a21
commit ae7666f8fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 819 additions and 815 deletions

View File

@ -41,152 +41,152 @@ exports[`renders ./components/avatar/demo/badge.md correctly 1`] = `
style="transition:none;-ms-transform:translateY(-1100%);-webkit-transform:translateY(-1100%);transform:translateY(-1100%)"
>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class="current"
class="ant-scroll-number-only-unit current"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>

View File

@ -17,12 +17,16 @@ function getNumberArray(num: string | number | undefined | null) {
: [];
}
function renderNumberList(position: number) {
function renderNumberList(position: number, className: string) {
const childrenToReturn: React.ReactElement<any>[] = [];
for (let i = 0; i < 30; i++) {
const currentClassName = position === i ? 'current' : '';
childrenToReturn.push(
<p key={i.toString()} className={currentClassName}>
<p
key={i.toString()}
className={classNames(className, {
current: position === i,
})}
>
{i % 10}
</p>,
);
@ -138,7 +142,7 @@ class ScrollNumber extends React.Component<ScrollNumberProps, ScrollNumberState>
},
key: i,
},
renderNumberList(position),
renderNumberList(position, `${prefixCls}-only-unit`),
);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -159,7 +159,7 @@
display: inline-block;
height: @badge-height;
transition: all 0.3s @ease-in-out;
> p {
> p.@{number-prefix-cls}-only-unit {
height: @badge-height;
margin: 0;
}

View File

@ -445,152 +445,152 @@ exports[`ConfigProvider components Badge configProvider 1`] = `
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
>
<p
class=""
class="config-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
4
</p>
<p
class="current"
class="config-scroll-number-only-unit current"
>
5
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="config-scroll-number-only-unit"
>
9
</p>
@ -625,152 +625,152 @@ exports[`ConfigProvider components Badge normal 1`] = `
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class="current"
class="ant-scroll-number-only-unit current"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="ant-scroll-number-only-unit"
>
9
</p>
@ -805,152 +805,152 @@ exports[`ConfigProvider components Badge prefixCls 1`] = `
style="transition:none;-ms-transform:translateY(-1500%);-webkit-transform:translateY(-1500%);transform:translateY(-1500%)"
>
<p
class=""
class="prefix-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
4
</p>
<p
class="current"
class="prefix-scroll-number-only-unit current"
>
5
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
9
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
0
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
1
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
2
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
3
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
4
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
5
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
6
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
7
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
8
</p>
<p
class=""
class="prefix-scroll-number-only-unit"
>
9
</p>